Note: this appears to have been fixed in Roslyn
This question arose when writing my answer to this one, which talks about the associativity of the n
I am not a C# expert at all as you can see from my question history, but, I tried this out and I think it is a bug.... but as a newbie, I have to say that I do not understand everything going on here so I will delete my answer if I am way off.
I have come to this bug conclusion by making a different version of your program which deals with the same scenario, but much less complicated.
I am using three null integer properties with backing stores. I set each to 4 and then run int? something2 = (A ?? B) ?? C;
(Full code here)
This just reads the A and nothing else.
This statement to me looks like to me it should:
So, as A is not null, it only looks at A and finishes.
In your example, putting a breakpoint at the First Case shows that x, y and z are all not null and therefore, I would expect them to be treated the same as my less complex example.... but I fear I am too much of a C# newbie and have missed the point of this question completely!