Here is some example code:
static DateTime time;
if (time == null)
{
/* do something */
}
Since DateTime
cannot be null, why does this code compile?
Edit:
The issue is not just that this code will always return false,but why something like DateTime
which is never null is allowed in such a comparison.