I have a function that looks something like this:
func test(closure: () -> ()) {
let localClosure = { closure() }
localClosure()
}
This is just an example and does not fully reflect the problem I am facing, obviously here I could just call closuredirectly!
It should be clear that the above code closurecannot exit. However, I get the error message:
Closing using the close option without the ability to escape may allow it to exit
Now, if localClosuresomehow escapes, I will understand this error, but it will not disappear. I even tried annotating localClosurehow @noescape(although this attribute is deprecated in Swift 3), and as per the warning, I got:
@noescape is default and deprecated
localClosure, , , ? / ?