<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 7, 2016, at 6:24 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 7, 2016, at 17:21, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 7, 2016, at 6:15 PM, Jordan Rose via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><div class=""><div class="" style="font-family: Palatino-Roman; font-size: 14px; font-style: normal; font-variant: 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;"> Today there's at least a simple rule: if the closure consists of a single expression (or a single return statement), the compiler will look at the body; otherwise it won't.</div></div></blockquote><div class=""><br class=""></div><div class="">Would it be so hard to have a rule that if there's an unambiguous expression as the last line of a closure that</div><div class="">it automagically acts as a default warn-on-unused-result return? So many of my two-line closures would</div><div class="">benefit from this.</div></div></div></div></blockquote><br class=""></div><div class="">What does that mean? You can't see how the closure is being called, so how do you know if the result is used or unused?</div><div class=""><br class=""></div><div class="">Jordan</div><br class=""></div></div></blockquote></div><br class=""><div class="">Okay, fine.</div><div class=""><br class=""></div><div class="">Would it be so hard to have a rule when there's an unambiguous expression as the last line of a closure that</div><div class="">it automagically acts as a default return? So many of my two-line closures would benefit from this.</div><div class=""><br class=""></div><div class="">-- E, clarifying</div><div class=""><br class=""></div></body></html>