[swift-evolution] [Proposal] Make non-escaping closures the default

Brent Royal-Gordon brent at architechies.com
Tue Jun 7 21:25:30 CDT 2016


> @escaping would be part of the parameter type just as @noescape is today. Your foo(closure:) example wouldn't compile with my proposal, the same as today if you marked the parameter with @noescape. Non-escaping function parameters are only allowed to be called. They can't be assigned to variables.

Okay, that does correct that issue. Although it raises a separate issue: a bare closure type now means something different in a parameter list than anywhere else.

Are generic types which happen to be functions in some particular use automatically @escaping? Are typealiases and associated types automatically @escaping?

Also, if `@escaping` is a part of the parameter list syntax (like `inout`) instead of the type syntax (like `@autoclosure`), would it make sense to drop its `@` sign to make them more syntactically similar?

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list