From ed81187e93180b69357b81f21ba620280b77d3bf Mon Sep 17 00:00:00 2001 From: Freddy Kellison-Linn Date: Fri, 17 Jan 2020 17:19:45 -0500 Subject: [PATCH 1/5] Add SE-0269 to the changelog --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31ec6a15fa35d..30057cd9026b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,33 @@ CHANGELOG +Swift Next +---------- + +* [SE-0269][]: + + When an escaping closure explicitly captures `self` it its capture list, the + use of implicit `self` is enabled within that closure. This means that the + following code is now valid: + + ``` + 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 --------- From 3d8070d6cf1e9eee86e090fe8fd23324c1f17d6d Mon Sep 17 00:00:00 2001 From: Freddy Kellison-Linn Date: Fri, 17 Jan 2020 17:21:18 -0500 Subject: [PATCH 2/5] Add missing quote --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30057cd9026b7..4c6d2f5358653 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,7 +47,7 @@ Swift Next ``` This proposal also introduces new diagnostics for inserting `self` into the - closure's capture list in addition to the existing 'use `self.` explicitly + closure's capture list in addition to the existing 'use `self.` explicitly' fix-it. Swift 5.2 From 217652ac377bc50f19a583048f5ec6ff409df647 Mon Sep 17 00:00:00 2001 From: Freddy Kellison-Linn Date: Sat, 18 Jan 2020 14:17:17 -0500 Subject: [PATCH 3/5] Add link for SE-0269 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c6d2f5358653..291820e1719e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7883,6 +7883,7 @@ Swift 1.0 [SE-0252]: [SE-0253]: [SE-0254]: +[SE-0269]: [SR-106]: [SR-419]: From 1c9542c2f2372f5a38a9b6deab0d07c6999bf3b6 Mon Sep 17 00:00:00 2001 From: Frederick Kellison-Linn Date: Sat, 18 Jan 2020 16:02:17 -0500 Subject: [PATCH 4/5] Add swift language annotation to code block Co-Authored-By: Suyash Srijan --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 291820e1719e8..f597e87675606 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ Swift Next 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 { From 0e6bd5080b7148a5a00914fe3ac63e75a639b247 Mon Sep 17 00:00:00 2001 From: Frederick Kellison-Linn Date: Wed, 22 Jan 2020 08:56:33 -0500 Subject: [PATCH 5/5] Fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f597e87675606..b3564bae5b6f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ Swift Next * [SE-0269][]: - When an escaping closure explicitly captures `self` it its capture list, the + 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: