[swift-evolution] Extending trailing closure sugar similar to property accessors

Slava Pestov spestov at apple.com
Thu Nov 2 19:51:19 CDT 2017



> On Nov 2, 2017, at 4:04 PM, Eric Summers via swift-evolution <swift-evolution at swift.org> wrote:
> 
> // A sugar similar to property accessors for multiple trailing closures:
> foobar(a: 1, b: 2) {
>     completionBlock { x, y in
>     // ...
>     }
>     failureBlock { i, j in
>     // ...
>     }
> }

This syntax is ambiguous. Are you passing in two trailing closures to foobar(), or a single trailing closure, inside which you call two top-level functions, completionBlock and failureBlock?

Slava

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171102/1e8dc09f/attachment.html>


More information about the swift-evolution mailing list