-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Diagnostics] Improve diagnostics for implicit (un)tupling. #28076
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
[Diagnostics] Improve diagnostics for implicit (un)tupling. #28076
Conversation
@swift-ci please smoke 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.
The additional notes and rewording of the one diagnostic help a little, but I don't think they go far enough. I've annotated some of the test cases with my opinions about how we should diagnose them.
@swift-ci please test |
Ugh, got a bunch of whitespace changes from the rebase. Force-pushed to remove those. @swift-ci please test |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@swift-ci please test |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@brentdax do the changes look good to you? I've added the fix-its for adding/deleting parens and tests for those. |
"and trying to match that instead", ()) | ||
WARNING(found_one_pattern_for_several_associated_values,none, | ||
"enum case '%0' has %1 associated values; matching them as a tuple " | ||
"is deprecated", (StringRef, unsigned)) |
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.
Apologies if I've paged something out, but why is this the only one of the three diagnostics which states that doing this is deprecated?
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.
In the other two cases, we most likely have a fix-it that either adds or removes parens (for example, you can look at the test cases), so I felt that providing an additional "this is deprecated" was not so useful. I can add that though, it is not a big deal.
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.
@brentdax what do you think of my response? Ok to not have the deprecated note because we are supplying fix-its? Or should I still add it?
@swift-ci please test |
Fixes rdar://problem/56436226.
@swift-ci please test |
Build failed |
Build failed |
Merging for now. We can tweak the diagnostic later again if desired. |
Fixes rdar://problem/56436226.