-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[SE-0365] Allow implicit self for weak self
captures
#40702
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
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
4eee6f8
Unconditionally permit implicit self in weak closures
calda 2292e38
Fix issue where implicit self wasn't rejected before self is unwrapped
calda 30f07e1
Fix edge cases
calda b1ebd95
Improve diagnostic for invalid use of implicit self before self is un…
calda d909365
Update tests
calda 5f8e567
Fix crash
calda 72074b3
Fix some test failures
calda 854f024
Fix issue where '@autoclosure () -> String = String()' would be rejec…
calda a5b3312
Fix more cases, write more test
calda e21b4d7
Reject normal ValueDecls but allow ConstructorDecl from '@autoclosure…
calda 66c89f1
More test fixes
calda 6c682b7
Fix another test failure, from a defer FuncDecl
calda 6fe7dc5
Always emit an error for invalid inner closures trying to use implici…
calda c6b4a20
Make more tests pass
calda 0cd9f19
Fix issue where 'let = MyCls()' in function body would unexpectedly …
calda 0a5e4e0
Fix incorrect DeclContext check
calda 20ed27a
Tests pass, except for 'capture 'y' was never used' issue
calda c03950b
Use LabeledConditionalStmt instead of just IfStmt / GuardStmt
calda ccdf807
Move weak self errors to their own file
calda 369e20f
Put back unused capture warnings
calda 0f33636
Update comments
calda 367b112
Fix last test failure
calda 778a2fc
Merge branch 'main' into cal--implicit-weak-self
calda 9167a17
Merge branch 'main' into cal--implicit-weak-self
calda 84896ed
Use Ctx.Id_self and update comments
calda 9e9f7be
Resolve UDRE to DRE in PreCheckExpr
calda 95949ce
Use ASTScope::lookupUnqualified instead of TypeChecker::resolveDeclRe…
calda 4abca2b
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2022-09-12-a' of github.com:app…
calda 03322bf
Move implicit self lookup from resolveDeclRefExpr into ASTScope::unqu…
calda 9dd56f9
Move remaining logic in LookupResultEntry::getBaseDecl() to ASTScope:…
calda 5946c66
Style updates
calda 94ef6c4
Permit implicit self for weak self captures in nonescaping closures i…
calda dfa1fda
fix warning annotation in test
calda 35e028e
Suppress more false-positive 'self is unused' warnings
calda e4b8a82
Remove properties from AST nodes
calda eae9b4e
Add SE-0365 to CHANGELOG.md
calda a4fac80
Update CHANGELOG.md
calda 21e94de
Move SE-0365 to Swift 6 section in changelog
calda cc92f76
Revert changes for handling SE-0365 in Swift 5
calda 5bfdfd8
Only enable SE-0365 in Swift 6
calda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Minor nit: this should go under Swift 5.8, since part of the feature is there, and we aren't release "Swift 6.0" any time soon.