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

Slava Pestov spestov at apple.com
Thu Nov 2 20:00:25 CDT 2017



> On Nov 2, 2017, at 5:58 PM, Eric Summers <eric_summers at icloud.com> wrote:
> 
> 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.

This is not possible in general, since we want the parser to be able to parse code without having knowledge of declarations and their types (which might come from other modules). Overloaded declarations complicate this further.

I agree that the existing property syntax already has this issue, which is unfortunate, but we should not introduce features that make the problem worse.

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


More information about the swift-evolution mailing list