-
Notifications
You must be signed in to change notification settings - Fork 442
Handle DeinitializerDeclSyntax
errors in a single diagnostic
#2185
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
Handle DeinitializerDeclSyntax
errors in a single diagnostic
#2185
Conversation
378a886
to
41a1737
Compare
41a1737
to
57625ba
Compare
e1e1df7
to
575d17e
Compare
@swift-ci please test |
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.
First off, apologies for not diving deep into the changes earlier. I initially responded to one of your comments and didn't go through the other changes. Now that you've requested a re-review, I've looked at all of them. So, my comments might be coming in a tad late. Feel free to take them or leave them; they're mostly minor suggestions. Overall, the changes look solid to me. That said, I don't feel fully equipped to weigh in on the underlying business logic just yet.
575d17e
to
dd980f7
Compare
No need to apologies. No worries! |
@swift-ci please test |
DiagnosticSpec(message: "deinitializers cannot have a name", fixIts: ["remove 'x'"]) | ||
DiagnosticSpec(message: "deinitializers cannot have name", fixIts: ["remove 'x'"]) |
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.
Hmm, this isn’t grammatically correct anymore. I think we need the a
in case the first element in the list is name
or return clause
.
addDiagnostic( | ||
returnType, | ||
.deinitCannotHaveReturnType, | ||
node, |
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.
Could we anchor this at nodes.first!
? That way the diagnostic actually shows up at the error unexpected nodes instead of the deinit
keyword. And also, I would add a highlight
for all the unexpected nodes (would be worth checking in at least one test case as well).
dd980f7
to
1c934d6
Compare
1c934d6
to
e63f6b7
Compare
e63f6b7
to
2b229e8
Compare
@swift-ci please test |
@swift-ci please test windows |
Part of #2021
I wanted to open this PR so we can discuss it isolated