Avatar
Avatar
Iceman
@swift-6.2.3 @swift-6.1.3@swift-6.0.3 func f(_: @escaping @Sendable () -> ()) {} func main() { nonisolated(unsafe) var foo = false f { print(foo) } foo.toggle() } (edited)
<stdin>:8:9: warning: 'foo' mutated after capture by sendable closure 2 | 3 | func main() { 4 | nonisolated(unsafe) var foo = false | `- note: variable defined here 5 | f { | `- note: variable captured by sendable closure 6 | print(foo) | `- note: capturing use 7 | } 8 | foo.toggle() | `- warning: 'foo' mutated after capture by sendable closure 9 | } 10 | (edited)