<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="">Done. <a href="https://bugs.swift.org/browse/SR-2963" class="">https://bugs.swift.org/browse/SR-2963</a>.<div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On 14 Oct 2016, at 22:42, John McCall &lt;<a href="mailto:rjmccall@apple.com" class="">rjmccall@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class="">On Oct 11, 2016, at 12:04 AM, Karl via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On 11 Oct 2016, at 08:49, Benjamin Spratling &lt;<a href="mailto:bspratling@mac.com" class="">bspratling@mac.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Howdy,<div class="">The error message is not saying that aFunction throws, it says “??" might throw. &nbsp;After all, you supplied a ()rethrows-&gt;(Int) to it as its second argument, which is wrapping a ()throws-&gt;Int, “bFunction()"</div><div class="">?? and &amp;&amp; and || wrap the trailing expression in an @autoclosure.</div><div class=""><div class=""><br class=""></div><div class="">I am a little surprised two “try” are not required. &nbsp;This would be my expectation:</div><div class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class=""><font face="Courier" class="">let&nbsp;value = try&nbsp;aFunction() ?? try bFunction()</font></div></blockquote></div></blockquote><div class="">but, using try to the right of a non-assignment operator is not allowed.</div><div class=""><br class=""></div>This, however, is not disallowed:</div><div class=""><br class=""></div><div class="">let&nbsp;value =&nbsp;try&nbsp;aFunction() ?? (try&nbsp;bFunction())</div><div class=""><div class=""><br class=""></div><div class="">The purpose of the @autoclosure is to make developers forget they need to write a closure, and it apparently worked for you.</div><div class=""><br class=""></div><div class="">-Ben Spratling</div><div class=""><br class=""></div></div></div></div></div></blockquote></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Yeah, I understand the reason for it, but I still think we should change it so you write the ‘try’ before the part which actually throws. Perhaps the rule should be something more general around rethrowing autoclosures?</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">After all, I thought that was the entire point of the ‘try’ keyword. The compiler doesn't really need it (it already knows what throws and what doesn’t), but it helps humans to mark where the throwing stuff happens.</div></div></blockquote><div class=""><br class=""></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I agree that you should be able to place the try inside the autoclosure and have that propagate out. &nbsp;This doesn't need evolution discussion; please file a bug.</span><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">John.</div></div></blockquote></div><br class=""></div></div></body></html>