dotnet / csharpstandard

Working space for ECMA-TC49-TG2, the C# standard committee.
Creative Commons Attribution 4.0 International
723 stars 86 forks source link

Null forgiving operator grammar issues #1190

Open jskeet opened 4 weeks ago

jskeet commented 4 weeks ago

The approach to specifying the null forgiving operator to prevent x!!! and the like causes some problems, and might be better dealt with as "make it valid in the grammar, but prohibit it in semantic text".

TG2: see Nigel's email about "null_forgiving_expression is either wrong or a lot of work for no gain" for more details.

jskeet commented 2 weeks ago

We agree with the approach. @Nigel-Ecma will create a PR, but may ask for suggestions for how we express "even if parenthesized, it's not valid" (e.g. ((x!))!).