<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Proposal link: <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0103-make-noescape-default.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0103-make-noescape-default.md</a><br class=""><br class="">Hello Swift Community,<br class=""><br class="">The review of "SE-0103: Make non-escaping closures the default" ran from June 21...27. The proposal is *accepted* for Swift 3 with a minor revision: instead of a “asUnsafeEscapingClosure(_:)" function that removes the @escaping attribute, the core team prefers a function with this signature (roughly) like:<div class=""><br class=""></div><div class=""><font face="Menlo" class="">&nbsp; func&nbsp;withoutActuallyEscaping&lt;ClosureType, ResultType&gt;(_ closure: ClosureType, do: (fn : @escaping ClosureType) -&gt; ResultType) -&gt; ResultType { … }<br class=""></font><br class="">This allows one to safely add the @escaping attribute in situations where a closure is known not to actually escape. &nbsp;For example, in a situation where you might want to use a lazy algorithm, you could use:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">&nbsp; func yourFunction(fn : (Int) -&gt; Int) { // fn defaults to non-escaping.</font></div><div class=""><span class="Apple-tab-span" style="white-space: pre;"><font face="Menlo" class="">    </font></span><span style="font-family: Menlo;" class="">withoutActuallyEscaping(fn) { fn in &nbsp;// fn is now marked @escaping inside the closure</span></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; &nbsp; ... somearray.lazy.map(fn)&nbsp;… &nbsp; &nbsp;&nbsp;&nbsp; // pass fn to something that is notationally @escaping</font></div><div class=""><span style="font-family: Menlo; white-space: pre;" class="">    }</span></div><div class=""><font face="Menlo" class="">&nbsp; }</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">The key to this approach is that the “withoutActuallyEscaping” function can verify that the closure has not actually escaped when it completes, providing a safe model for locally adding the @escaping attribute when needed. &nbsp;The core team believes that the actual implementation of&nbsp;withoutActuallyEscaping will require some magic, but that it should be implementable.</div><div class=""><br class=""></div><div class="">Many thanks to Trent Nadeau for driving this proposal forward. &nbsp;I filed SR-1952 to track implementation of this feature.<br class=""><br class="">-Chris Lattner<br class="">Review Manager<br class=""><br class=""><br class=""></div></body></html>