-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Improve parser recovery around nullable types in patterns #72805
Improve parser recovery around nullable types in patterns #72805
Conversation
src/Compilers/CSharp/Test/Syntax/Parsing/NullableParsingTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Syntax/Parsing/NullableParsingTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Syntax/Parsing/PatternParsingTests_ListPatterns.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Syntax/Parsing/SwitchExpressionParsingTests.cs
Show resolved
Hide resolved
Done with pass. Overall approve of the high level idea. Def wary of the actual code change (i don't understand it yet), and def think we need to beef up tests to ensure that things that are now legal to parse give proper diagnostics. |
src/Compilers/CSharp/Test/Syntax/Parsing/SwitchExpressionParsingTests.cs
Show resolved
Hide resolved
@333fred Can I have a review here? |
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.
Done review pass, only a couple of minor things. @dotnet/roslyn-compiler for a second review.
src/Compilers/CSharp/Test/Syntax/Parsing/PatternParsingTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Fred Silberberg <[email protected]>
Co-authored-by: Fred Silberberg <[email protected]>
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.
@dotnet/roslyn-compiler for a second review
@333fred I noticed that there was a regression of parsing an async simple lambda in a conditional expression after pattern. Need another look from you yo approve the change |
@RikkiGibson You self-assigned here, can you please take a look then? |
{ | ||
N(SyntaxKind.IdentifierName); | ||
{ | ||
N(SyntaxKind.IdentifierToken, "Type"); |
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.
I am confused by this parse :). It seems reasonable for =>
to end a pattern. But it seems like we're turning the =>
into a skipped token? Not sure why. Pausing here till I get back from lunch.
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.
Some of the parses confuse me a bit especially around where I left the comment. But, it seems fine to me, these are error cases anyway, and we're just doing a best effort to come up with a parse that will hopefully result in the most useful errors.
Thanks @DoctorKrolic! |
…solution-priority * upstream/main: (184 commits) Disable BuildWithNetFrameworkHostedCompiler (dotnet#74299) Avoid using constants for large string literals (dotnet#74305) Adjust lowering of a string interpolation in an expression lambda to not use expanded non-array `params` collection in Format/Create calls. (dotnet#74274) Consolidate test Span sources (dotnet#74281) Allow Document.FilePath to be set to null (dotnet#74290) Update Directory.Build.rsp Remove fallback options from IdeAnalyzerOptions (dotnet#74235) Fix msbuild issue Improve parser recovery around nullable types in patterns (dotnet#72805) Syntax formatting options (dotnet#74223) Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2490585 (dotnet#74287) fix (dotnet#74276) Remove more fix (dotnet#74237) Fix scenario where lightbulbs weren't being displayed Reduce closures allocated during invocation of CapturedSymbolReplacement.Replacement (dotnet#74258) Reduce allocations in SymbolDeclaredCompilationEvent (dotnet#74250) remove type that now serves no purpose Remove uncalled method Remove more unused code ...
Closes: #72720