Incorrect location for missing semicolon error after whitespace change #31161
Labels
Area-Compilers
Bug
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
Language-C#
Milestone
Version Used: 2.9.0, 2.11.0-beta3-63513-06
Steps to Reproduce:
Run the following code:
Expected Behavior:
Both syntax trees report the missing semicolon error just after the closing parenthesis on line 5. In other words, in both cases, the reported location should be (5,12).
Actual Behavior:
In the second syntax tree, the reported location is (5, 10), i.e. on the opening parenthesis:
I think this happens because the
SyntaxDiagnosticInfo
is created with offset of -2 when the tree is parsed, which works correctly for the original tree. But when the whitespace is updated, the offset causes the incorrect location.The text was updated successfully, but these errors were encountered: