Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion proposals/0439-trailing-comma-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,20 @@ This proposal adds support for trailing commas in symmetrically delimited comma-
}
```

- Generic parameters.
- Generic parameter lists and generic argument lists.

```swift
struct S<
T1,
T2,
T3,
> { }

let s = S<
T1,
T2,
T3,
>()
```

- String interpolation.
Expand All @@ -166,6 +172,8 @@ This proposal adds support for trailing commas in symmetrically delimited comma-

Trailing commas will be supported in comma-separated lists when symmetric delimiters (including `(...)`, `[...]`, and `<...>`) enable unambiguous parsing.

Note that the requirement for a comma-separated list means that `let x: [Int,] ❌` will not be supported, since a list of types is never supported in that context. Likewise, built-in attributes that don't parse their arguments as a comma-separated list will not support trailing comma, such as `@inline(never,) ❌`.

Note that the requirement for symmetric delimiters means that the following cases will not support trailing comma:

- `if`, `guard` and `while` condition lists.
Expand Down