Skip to content

Commit ceafaed

Browse files
Merge pull request #5265 from dotty-staging/fix-5260
Fix #5260: Type TupleXXL.apply as TupleXXL
2 parents 2063e85 + 82461a5 commit ceafaed

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ class Typer extends Namer
18111811
val tupleXXLobj = untpd.ref(defn.TupleXXLModule.termRef)
18121812
val app = untpd.cpy.Apply(tree)(tupleXXLobj, elems1.map(untpd.TypedSplice(_)))
18131813
.withPos(tree.pos)
1814-
val app1 = typed(app, pt)
1814+
val app1 = typed(app, defn.TupleXXLType)
18151815
if (ctx.mode.is(Mode.Pattern)) app1
18161816
else {
18171817
val elemTpes = (elems, pts).zipped.map((elem, pt) =>

tests/run/i5260.check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23)

tests/run/i5260.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
object Test {
2+
3+
def main(args: Array[String]): Unit = {
4+
println(f23((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)))
5+
}
6+
7+
def f23(x: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)): String = x.toString
8+
}

0 commit comments

Comments
 (0)