<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 21, 2016, at 9:37 AM, Jordan Rose via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">-1 for the signature change. The most common case of autoreleasepool does <i class="">not</i> return a value <i class="">and</i> has a multi-statement body that prevents the result type from being inferred. This needs to continue to work:</div><div class=""><br class=""></div><div class="">autoreleasepool {</div><div class=""> foo()</div><div class=""> bar()</div><div class="">}</div><div class=""><br class=""></div><div class="">If we had a rule to default generic return values to Void if they aren't used then I'd be okay with it, but that'd be a separate proposal. (Providing two overloads may also work; haven't tested it.)</div></div></div></blockquote><div><br class=""></div><div>I understand that Jordan withdrew his objection later (because no overload is required) but it still isn't clear to me that autoreleasepool should return a value.</div><div><br class=""></div><div>Here’s my thought process: autoreleasepool is *intentionally* looking like a statement, not an expression. Someday I hope it will be possible to break/continue/return/throw out of a closure, and at that point, it will look exactly like a statement.</div><div><br class=""></div><div>The problem with adding a return value for this is that (so far) we don’t allow the same thing to ‘do’, ‘if’, ‘switch’ and other statements. I’d argue that autoreleasepool should follow as close as possible in do’s footsteps: if/when we decide to expressionize these statements, at that point should we expressionize autoreleasepool to match.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div></div></body></html>