[swift-evolution] Guaranteed closure execution

Chris Lattner clattner at apple.com
Sun Jan 31 22:47:45 CST 2016


On Jan 31, 2016, at 9:54 AM, Dany St-Amant via swift-evolution <swift-evolution at swift.org> wrote:
>>> it is not required to be executed on a code path that throws;
>> 
>> 
>> It may need to be clarified into "must" or "must not", but I can't think about very good examples supporting either case right now.
>> 
> 
> What is the implication of this @noescape(once) closure not being call on throws when the caller use try? variation?

The compiler needs a guarantee one way or the other (that the closure is called or that it is not called), because it needs to know whether to clean up values initialized by the closure.

-Chris



More information about the swift-evolution mailing list