Explicit self required unexpectedly when capturing self in closure with Swift 6 SE-0365 #79014
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
An example that looks like it should be allowed by https://github.com/swiftlang/swift-evolution/blob/main/proposals/0365-implicit-self-weak-capture.md is causinga compile error
Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit
.This was discovered after running swiftformat which removed a (seemingly) redundant
self
.nicklockwood/SwiftFormat#1732
Reproduction
Expected behavior
Code should compile without the explicit
self
.I see that SE-0365 has quite a lot about nested closures so I realise I may be missing something that this is expected.
Environment
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: