[swift-users] Compiler can't infer map transfer closure return type?
erica at ericasadun.com
Mon Mar 7 19:21:38 CST 2016
> On Mar 7, 2016, at 6:15 PM, Jordan Rose via swift-users <swift-users at swift.org> wrote:
> 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.
Would it be so hard to have a rule that if there's an unambiguous expression as the last line of a closure that
it automagically acts as a default warn-on-unused-result return? So many of my two-line closures would
benefit from this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users