Guid == null should not be allowed by the compiler
The behaviour described below is specific to .net-3.5 only I just ran across the most astonishing behavior in the C# compiler; I have the following code: Guid g1 = Guid.Empty; bool b1= (g1 == null); Well, Guid is not nullable therefore it can never be equal to null . The comparison i'm making in line 2 always returns false . If you make the same thing for an integer, the compiler issues an warning saying the result will always be false: int x=0; bool b2= (x==null); My question is: Why does the compiler lets you compare a Guid to null ? According to my knowledge, it already knows the result is