[swift-users] Compiler can't infer map transfer closure return type?

Erica Sadun 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.

-- E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160307/ed341685/attachment.html>

More information about the swift-users mailing list