We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The below code reports parsing errors in the recursive patterns R(E.A), R(E.A or E.B), (E.A):
R(E.A)
R(E.A or E.B)
(E.A)
void M(R expr) { var x = expr is R(E.A) v0; var y = expr is R(E.A or E.B) v1; var z = expr is (E.A or E.B) v2; } record R(E e) { } enum E { A, B }
This is a recurring coding pattern in Roslyn.
The text was updated successfully, but these errors were encountered:
There's no parse error for
void M() { var a = expr switch { R(E.A) => 1 }; }
So the above might be related to is [pattern].
is [pattern]
At the same time, the sample added to this comment produces incorrect AST for the pattern:
(switch_expression_arm [4, 8] - [4, 19] (constant_pattern [4, 8] - [4, 14] (invocation_expression [4, 8] - [4, 14] function: (identifier [4, 8] - [4, 9]) arguments: (argument_list [4, 9] - [4, 14] (argument [4, 10] - [4, 13] (member_access_expression [4, 10] - [4, 13] expression: (identifier [4, 10] - [4, 11]) name: (identifier [4, 12] - [4, 13]))))))
The pattern should be a recursive pattern and not a constant one.
Sorry, something went wrong.
Are there any updates on this?
No branches or pull requests
The below code reports parsing errors in the recursive patterns
R(E.A)
,R(E.A or E.B)
,(E.A)
:This is a recurring coding pattern in Roslyn.
The text was updated successfully, but these errors were encountered: