Does the method on the left side of the ?? operator in C# get called twice? Once for the evaluation and once for the assignment?
In the following line:
int i = GetNullableInt() ?? default(int);
I would assume that the GetNullableInt()
method would need to be called first, so the result could be evaluated, before making the assignment. If this does NOT happen then the variable "i" would need to be assigned and then evaluated which seems dangerous for the item receiving the assignment in that, during an object assignment, it could theoretically be prematurely assigned a null value during the first stage only to have it replaced by the result of the method on the right.