-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SE-0365] Allow implicit self in inner functions in [weak self] closures, like with [self] closures #65211
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
[SE-0365] Allow implicit self in inner functions in [weak self] closures, like with [self] closures #65211
Conversation
…with [self] closures
0e7479c
to
9e55fb0
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.
Thank you! I left a few comments inline, I would be great to get a few cases with more nesting and i.e. inits and subscripts involved (both valid and invalid)
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.
Thank you!
@swift-ci please test |
@swift-ci please test source compatibility |
The one issue in the Release source compat suite is unrelated:
|
This PR fixes an issue in the implementation of SE-0365, where implicit self was disallowed inside inner function declarations:
The intent of SE-0365 is to mirror the behavior of SE-0269 with
[self]
captures. This usage is allowed by SE-0269, so it should be allowed by SE-0365 as well:I confirmed on the forums that this was an intentional design choice of SE-0269.
Please review: @xedin