Skip to content

Grammar for closure-expression is incomplete [SE-0316] #436

Description

@jansorg

Location

https://docs.swift.org/swift-book/documentation/the-swift-programming-language/summaryofthegrammar#Expressions

Description

The grammar of closure-expression does not allow attributes before in:

For example:

Task.detached { @MainActor in
  // ...
}

As far as I can tell this syntax has been added by https://github.com/swiftlang/swift-evolution/blob/main/proposals/0316-global-actors.md#closures

The current grammar is closure-expression → { attributes? closure-signature? statements? }, which only would allow { @Something ... } but not { @Something in ... }.
This was added by acb77ae

Correction

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions