[swift-evolution] [Pitch] Move @noescape

Chris Lattner clattner at apple.com
Thu Mar 3 18:14:54 CST 2016


> On Mar 3, 2016, at 4:10 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Mar 3, 2016, at 2:14 PM, Jacob Bandes-Storch <jtbandes at gmail.com <mailto:jtbandes at gmail.com>> wrote:
>> 
>> Will this allow me to write "let myDispatchSync = dispatch_sync as! @noescape () -> Void"  ? :-D
> 
> Yes,  but you need to spell it like this:
> 
> 	let myDispatchSync = dispatch_sync as! ((dispatch_queue_t, @noescape @convention(block) () -> ()) -> Void)

Ah, while this syntactically parses, but the cast is considered to fail at runtime given that it is not a safe conversion.  This is the domain of an unsafe cast.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160303/2a01550c/attachment.html>


More information about the swift-evolution mailing list