Possible Duplicate:
C# okay with comparing value types to null
Consider the following code with the TimeSpan, which is a struct:
// will not compile - illegal
TimeSpan ts = null;
However, the following code does compile and is legal, though the expression is always false:
if (ts == null)
Console.WriteLine("this line will never be hit");
Can someone tell me why it's invalid to set a struct to a NULL, but it's ok to compare it to one?