Skip to content

Add SE-0269 to the changelog #29285

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 5 commits into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,33 @@ CHANGELOG

</details>

Swift Next
----------

* [SE-0269][]:

When an escaping closure explicitly captures `self` in its capture list, the
use of implicit `self` is enabled within that closure. This means that the
following code is now valid:

```swift
func doStuff(_ stuff: @escaping () -> Void) {}

class C {
var x = 0

func method() {
doStuff { [self] in
x += 1
}
}
}
```

This proposal also introduces new diagnostics for inserting `self` into the
closure's capture list in addition to the existing 'use `self.` explicitly'
fix-it.

Swift 5.2
---------

Expand Down Expand Up @@ -7856,6 +7883,7 @@ Swift 1.0
[SE-0252]: <https://github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
[SE-0253]: <https://github.com/apple/swift-evolution/blob/master/proposals/0253-callable.md>
[SE-0254]: <https://github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>
[SE-0269]: <https://github.com/apple/swift-evolution/blob/master/proposals/0269-implicit-self-explicit-capture.md>

[SR-106]: <https://bugs.swift.org/browse/SR-106>
[SR-419]: <https://bugs.swift.org/browse/SR-419>
Expand Down