A similar problem exists with property accessors.  Although you could call 
those keywords, they will probably be extensible when behaviors are introduced 
leading to a similar situation.  It can be worked around by making the priority 
of argument labels higher then function calls within the curly brackets.

Eric

> On Nov 2, 2017, at 8:51 PM, Slava Pestov via swift-evolution 
> <[email protected]> wrote:
> 
> 
> 
>> On Nov 2, 2017, at 4:04 PM, Eric Summers via swift-evolution 
>> <[email protected] <mailto:[email protected]>> 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
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to