▲ | Metasyntactic 4 days ago | |||||||
Hi there! One of the lang designers here. That's been part and parcel for C# for over 10 years at this point. When we added `?.` originally, it was its nature that it would not execute code that was now unnecessary due to the receiver being null. For example:
This would already not run anything on the RHS of the `?.` if `Settings` was null.So this feature behaves consistently with how the language has always treated this space. Except now it doesn't have an artificial limitation on which 'expression' level it stops at. | ||||||||
▲ | SideburnsOfDoom 4 days ago | parent [-] | |||||||
I get that the language syntax is now (slightly) more regular. But also, reading the code will mean keeping track of (slightly) more possible outcomes. | ||||||||
|