class B {
func bar() {}
}
class A {
var thing: B? { fatalError() }
func foo() {
let thing2 = B()
let _: (Bool) -> Void = { [weak thing = thing2] _ in
thing?.bar()
}
}
}
In the closure self. is inserted before thing even though it shouldn't be since the thing binding in the capture list was the intended target
With this code:
In the closure
self.
is inserted beforething
even though it shouldn't be since thething
binding in the capture list was the intended target