Avatar
SR-5719: In Swift 5 mode, @autoclosure parameters can no longer be forwarded to @autoclosure arguments in another function call. Instead, you must explicitly call the function value with (); the call itself is wrapped inside an implicit closure, guaranteeing the same behavior as in Swift 4 mode. Example: func foo(_ fn: @autoclosure () -> Int) {} func bar(_ fn: @autoclosure () -> Int) { foo(fn) // Incorrect, `fn` can't be forwarded and has to be called foo(fn()) // Ok }
2:02 AM
The Swift Programming Language. Contribute to slavapestov/swift development by creating an account on GitHub.
2:02 AM
@norio_nomura が前話してたautoclosureの仕様変更、Swift5向けの変更だってハッキリ書かれてた (edited)
👍 1