Closed ikesyo closed 6 years ago
That error is completely wrong. The block passed to Objective-C does not escape. It is called, not retained, and the function exits.
This looks like a bug in Swift 4.2's runtime checking. In any case, I'll have a look this evening and see if I can find a work-around.
According to Swift developer Joe Groff, this is a confirmed Swift 4.2 bug.
https://twitter.com/jckarter/status/1004521338575261696
I'll still look for a workaround since I have no idea how long it will take this issue to be resolved in Xcode.
Yes, this is a Swift compiler bug (I and @phatblat are the reporters of this in the Swift lab).
Current workaround is https://github.com/Quick/Nimble/pull/537.
The fix for the compiler bug is somehow included in Xcode 10 beta 3 (https://github.com/Quick/Nimble/pull/560), so I'm closing this.
This is rdar://40857699 which is originally found in https://github.com/Quick/Nimble/pull/530.