-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix Issue #63993 by improving out-of-place binding diagnostic and reflecting 'var' or 'let' binding pattern #64422
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 Issue #63993 by improving out-of-place binding diagnostic and reflecting 'var' or 'let' binding pattern #64422
Conversation
@hamishknight
|
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.
Definitely on the right track! The remaining items on your list sound good to me
Done! |
a01927d
to
6decd93
Compare
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.
Looks great! I have a few more comments, but otherwise this looks good to me. A couple more things that also need doing before we can land this:
- Can you run
git clang-format
over this change? If not already installed, you should be able to installclang-format
with homebrew. - You'll need to update any tests that have had their diagnostics changed. Off the top of my head, I know there are a couple of cases in
test/Sema/redeclaration-checking.swift
that will need changing to expect'let' binding pattern
instead of'var' binding pattern
(and there's aFIXME
comment you can now remove).
Hey there, I will make the changes, thanks for the review! |
I don't find any such case in the mentioned file, no 'FIXME' comment as well. The only similar cases I observed were the ones with the 'redeclaration' issue or similar. |
3318d8c
to
a76965c
Compare
Apart from that, I have done the changes! |
Hey! Looks like my codebase isn't updated since a while, cause the number of LOC in the file referenced is barely around ~120. Probably I should |
Ah that makes sense, be sure to |
ebe51fb
to
99b756f
Compare
Well, that's done, hope there aren't any more test files which need changes! |
99b756f
to
0475a97
Compare
Mistakenly had closed this pull request for a second! |
…' binding pattern Fixes Issue swiftlang#63993
0475a97
to
c34f099
Compare
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.
Wonderful, thank you!
Let's find out :) @swift-ci please test |
Observed an issue! I ran the tests specifically for the test file in context:
|
|
@Rajveer100 Did you rebuild after rebasing your branch? Those test failures sound like you have a build that was done before #63994 |
Ah yes, forgot about that! |
A question! |
Sure, the details are documented in https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#pull-request-testing. In short, a full test runs more configurations (e.g different targets, different optimization levels) than a smoke test. Personally I tend on the side of doing a full test unless the change is fairly trivial (e.g something like a light refactoring), though honestly it's probably overkill for a change like this. |
All checks passed! |
Fixes Issue #63993
Added a new 'DescriptivePatternKind' declaration with its methods and functionality similar to 'DescriptiveDeclKind', thereby allowing binding pattern check in the appropriate places for 'var' or 'let' and improving the overall diagnostics.