-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix null refs when calling GetLocation() or GetDiagnostics() of freshly constructed syntax trivia
#81444
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
base: main
Are you sure you want to change the base?
Conversation
CyrusNajmabadi
left a comment
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.
Yup. Seems to match SyntaxToken now.
CyrusNajmabadi
left a comment
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.
Yup. Seems to match SyntaxToken now.
|
Can I have a review here please?! |
| { | ||
| // https://github.com/dotnet/roslyn/issues/40773 | ||
| return this.SyntaxTree!.GetDiagnostics(this); | ||
| return this.SyntaxTree?.GetDiagnostics(this) ?? SpecializedCollections.EmptyEnumerable<Diagnostic>(); |
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.
Consider making the title more detailed. For example by mentioning what APIs are getting fixed/changed |
|
Done with review pass (commit 1) |
GetLocation() or GetDiagnostics() of freshly constructed syntax trivia
Fixes: #40773
Matches behavior of syntax token in test above