Skip to content

The grammar is missing trailing commas [SE-0439] #418

@jansorg

Description

@jansorg

Location

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

Description

As far as I can tell, the changes for https://github.com/swiftlang/swift-evolution/blob/main/proposals/0439-trailing-comma-lists.md are not yet contained in the official grammar.

At least the trailing comma of a function-call-expression is not contained in the grammar:

func first(first: String, second: String) -> String {
    return first
}

func something() -> String {
    return first(
        first: "a",
        second: "b"
    )
}

Correction

If I'm not mistaken, the rule for function-call-argument-list should allow a trailing comma.

rdar://144570685

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content issueA problem in with the book's prose, code, or figures

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions