-
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
Fix incremental parsing error with dot-dot tokens. #75532
Fix incremental parsing error with dot-dot tokens. #75532
Conversation
@@ -584,6 +584,62 @@ int LocalFunc() | |||
WalkTreeAndVerify(tree.GetCompilationUnitRoot(), fullTree.GetCompilationUnitRoot()); | |||
} | |||
|
|||
[Fact] |
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.
WorkItem :)
I'll look at this. |
@@ -4118,7 +4118,7 @@ public void OperatorDeclaration_ExplicitImplementation_21() | |||
UsingDeclaration("public int I..operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), | |||
// (1,14): error CS1001: Identifier expected | |||
// public int I..operator +(int x) => x; | |||
Diagnostic(ErrorCode.ERR_IdentifierExpected, ".operato").WithLocation(1, 14) | |||
Diagnostic(ErrorCode.ERR_IdentifierExpected, ".").WithLocation(1, 14) |
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.
these are better. the old results were wacky.
@dotnet/roslyn-compiler for an incremental parsing bug. |
// on the dot token itself. This will make this token not reusable in incremental scenarios. The missing | ||
// identifier is already not reusable (as it has zero length). However, this does not taint the tokens | ||
// around it. We want that tainting so that an incremental reparse goes and resynthesizes the original `..` | ||
// token. |
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.
this is the critical part of the fix. previously we had dot token - missing identifier - dot token
and the incremental parser was reusing those dot tokens, even though they are not what the lexer would have produced.
….com/Rekkonnect/roslyn into fix/74456-incremental-parsing-dotdot
@RikkiGibson @cston ptal. |
Taking #75549 instead. Thanks! |
Fixes #74456
This was approved by @CyrusNajmabadi to open as a draft PR to debug. The test source is a minified example of that of the original PR.