-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
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
Parse [
after nullable type as part of the type
#55044
Conversation
Before this change, In reply to: 885021921 Refers to: src/Compilers/CSharp/Portable/Parser/LanguageParser.cs:6861 in 4b559f9. [](commit_id = 4b559f9, deletion_comment = False) |
@dotnet/roslyn-compiler, please review this fix for parsing nullable array types in |
[Fact] | ||
public void NullableType_Switch_03() | ||
{ | ||
string source = "x switch { string? [A] y => y }"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes me glad that we decided to separate list-pattern from the more general recursive pattern ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (iteration 2)
Approved by BU and Division triage in email. Can be merged to 16.11 |
Parse
? [
as a nullable array type always inswitch
andis
expression pattern types:x switch { string ? [] y => y }
As a result, parentheses are required when the
[
starts a lambda expression with attributes:x is string ? ([A] y => y) : z
Fixes #55013.