[throw expression specification] Several questions #3204
Unanswered
RexJaeschke
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue 1: Grammar Question #1
The proposal I started with contained the following grammar:
null_coalescing_expression : throw_expression ;
Now the existing grammar for null_coalescing_expression is
So, I'm thinking the new grammar should be these two combined, as follows:
Is that correct?
Issue 2: Grammar Question #2
Given the final grammar in the previous issue, is the production null_coalescing_expression the only place that refers to the new production, "throw_expression"? Basically, I'm trying to figure out the precedence of this new throw-expression operator.
Issue 3: Result type of
?:
operatorThe initial proposal stated that
A throw expression shall only occur in the following syntactic contexts:
?:
).I think that bullet should be
?:
), but not both.because if in e1
?
e2:
e3, both e2 and e3 are throw expressions, they have no common type, and the compiler reports, "Error CS0173 Type of conditional expression cannot be determined because there is no implicit conversion between '<throw expression>' and '<throw expression>'.Am I correct?
Beta Was this translation helpful? Give feedback.
All reactions