Skip to content

Commit e3aaa21

Browse files
authored
[SE-0439] Editorial clarifications on trailing comma support (#3057)
* [SE-0439] Editorial clarifications on trailing comma support As raised in swiftlang/swift-book#421, clarify that trailing comma support is present for both generic _parameter_ lists and generic _argument_ lists. While we're at it, add a brief sentence to the detailed design to match the decision note to clarify the requirement for a comma-separated _list_. * [SE-0439] Fixup to use a more standard spelling for initialization
1 parent 24dc59c commit e3aaa21

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

proposals/0439-trailing-comma-lists.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,20 @@ This proposal adds support for trailing commas in symmetrically delimited comma-
146146
}
147147
```
148148

149-
- Generic parameters.
149+
- Generic parameter lists and generic argument lists.
150150

151151
```swift
152152
struct S<
153153
T1,
154154
T2,
155155
T3,
156156
> { }
157+
158+
let s = S<
159+
T1,
160+
T2,
161+
T3,
162+
>()
157163
```
158164

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

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

175+
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,) `.
176+
169177
Note that the requirement for symmetric delimiters means that the following cases will not support trailing comma:
170178

171179
- `if`, `guard` and `while` condition lists.

0 commit comments

Comments
 (0)