Uploaded image for project: 'Swift'
  1. Swift
  2. SR-12583

`foo() {} {}` parses but `foo {} {}` does not

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:

      Description

      If you have a function that takes a function, then returns a function that takes another function:

      func foo(_: ()->()) -> (() -> ()) -> () { fatalError() }
      

      Then you can call it like this:

      foo() {} {}
      

      but this doesn't parse:

      foo {} {}
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            jckarter Joe Groff
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated: