Skip to content

Commit 093535d

Browse files
committed
Enable SE-0365 behavior in Swift 5.8
1 parent 3f02037 commit 093535d

File tree

5 files changed

+237
-80
lines changed

5 files changed

+237
-80
lines changed

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
_**Note:** This is in reverse chronological order, so newer entries are added to the top._
44

5-
## Swift 6.0
5+
## Swift 5.8
66

77
* [SE-0365][]:
88

99
Implicit `self` is now permitted for `weak self` captures, after `self` is unwrapped.
1010

11-
For example, the usage of implicit `self` below is now permitted:
11+
For example, the usage of implicit `self` below is permitted:
1212

1313
```swift
1414
class ViewController {
@@ -44,8 +44,6 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
4444

4545
In Swift 6, the above code will no longer compile. `weak self` captures in non-escaping closures now have the same behavior as captures in escaping closures (as described in [SE-0365][]). Code relying on the previous behavior will need to be updated to either unwrap `self` (e.g. by adding a `guard let self else return` statement), or to use a different capture method (e.g. using `[self]` or `[unowned self]` instead of `[weak self]`).
4646

47-
## Swift 5.8
48-
4947
* [SE-0362][]:
5048

5149
The compiler flag `-enable-upcoming-feature X` can now be used to enable a specific feature `X` that has been accepted by the evolution process, but whose introduction into the language is waiting for the next major version (e.g., version 6). The `X` is specified by any proposal that falls into this category:

0 commit comments

Comments
 (0)