Skip to content

Commit 7bafabd

Browse files
committed
removed example with multiline multielement tuple, since it different in different variants
and more text cleanup
1 parent d2f61eb commit 7bafabd

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

content/NNN-one-element-tuple-syntax.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ There is also no concise syntax for empty tuple types - `EmptyTuple` must be wri
6767
val empty: EmptyTuple = EmptyTuple // No shorthand syntax available
6868
```
6969

70-
Scala supports trailing commas in multi-line contexts (parameters, arguments, imports, tuples, etc.) when the closing delimiter is on its own line (SIP-27). However, there is no way to use a trailing comma to disambiguate single-element tuples from parenthesized expressions, since `(a,)` is a syntax error.
71-
7270
## Proposed Solution
7371

7472
### High-Level Overview
@@ -178,15 +176,6 @@ val x = (1,
178176

179177
Should this be a single-element tuple `(1,)` or a parenthesized expression `(1)` with an ignored trailing comma? This proposal ensures it is consistently parsed as a single-element tuple, regardless of whitespace.
180178

181-
Similarly, for multi-element tuples:
182-
183-
```scala
184-
val y = (1, 2,
185-
)
186-
```
187-
188-
The trailing comma is preserved and parsed as part of the tuple syntax.
189-
190179
The implementation requires slightly more complex interaction between the scanner and parser to preserve trailing commas in tuple contexts while maintaining existing behavior elsewhere.
191180

192181
#### Interaction with Pattern Matching

0 commit comments

Comments
 (0)