docs/_docs/reference/error-codes/E014.md
This error was removed before Scala 3.0.0 was released and was never emitted by the Scala 3 compiler.
This error was triggered when creating a tuple literal with more than 22 elements.
val t = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)
-- [E014] Syntax Error: example.scala:1:8 --------------------------------------
1 |val t = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)
| ^
| A tuple cannot have more than 22 members
In early versions of Dotty (before Scala 3.0.0), tuples were limited to 22 elements, similar to Scala 2. The error message suggested using nested tuples as a workaround:
// Workaround with nested tuples (no longer needed)
val t = ((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22), (23))
This restriction was removed in commit 2d1427d5aa (August 2018) with "Allow tuple literals to extend beyond 22". Since Scala 3.0.0, tuples can have any number of elements without restriction.
<!-- SOURCE-ONLY: Remove the notice below once this page has been manually updated. --> <aside class="warning"> This reference page was created with LLM assistance - the description of the error code may not be accurate or cover all possible scenarios. </aside>