Skip to content

Commit 2e8ea24

Browse files
Factor out TupleXXL arity check
1 parent 8ae6ad4 commit 2e8ea24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,9 +1098,9 @@ object desugar {
10981098
val firstDef =
10991099
ValDef(tmpName, TypeTree(), matchExpr)
11001100
.withSpan(pat.span.union(rhs.span)).withMods(patMods)
1101-
val arity = vars.length
1101+
val useSelectors = vars.length <= 22
11021102
def selector(n: Int) =
1103-
if arity <= 22 then Select(Ident(tmpName), nme.selectorName(n))
1103+
if useSelectors then Select(Ident(tmpName), nme.selectorName(n))
11041104
else Apply(Select(Ident(tmpName), nme.apply), Literal(Constant(n)) :: Nil)
11051105
val restDefs =
11061106
for (((named, tpt), n) <- vars.zipWithIndex if named.name != nme.WILDCARD)

0 commit comments

Comments
 (0)