null coalescing operator is right associative, which means an expression of the form
first ?? second ??third
is eva
Jon's answer is correct.
Just to be clear: the ??
operator in C# is right associative. I have just gone through the binary operator parser and verified that the parser treats ??
as right-associative.
As Jon points out, the spec says both that the ??
operator is right-associative, and that all binary operators except assignment are left-associative. Since the spec contradicts itself, clearly only one of these can be right. I will have the spec amended to say something like:
Except for the simple assignment, compound assignment and null coalescing operators, all binary operators are left-associative
UPDATE: As noted in the comments, the lambda operator =>
is also right-associative.