C# 5.0 仕様は、7.1.3 章で読み取ります
https://msdn.microsoft.com/en-us/library/ms228593.aspx
false
一方または両方のオペランドがの場合、持ち上げられた演算子は値を生成しますnull
。
ただし、テストとこの MSDN リンクも
http://msdn.microsoft.com/en-us/library/2cf62fcy(v=vs.100).aspx
int? num1 = 10;
int? num2 = null;
// Change the value of num1, so that both num1 and num2 are null.
num1 = null;
if (num1 == num2)
{
// The equality comparison returns true when both operands are null.
Console.WriteLine("num1 == num2 returns true when the value of each is null");
}
/* Output:
* num1 == num2 returns true when the value of each is null
*/
null
は、どちらも を返す2 つの null 許容値を比較することを示していますtrue
。
理にかなっていますが、仕様の文と矛盾していますね。