From 82461a534a22cce51b44ab9ac114fb43edfbf630 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 16 Oct 2018 16:07:01 +0200 Subject: [PATCH] Fix #5260: Type TupleXXL.apply as TupleXXL --- compiler/src/dotty/tools/dotc/typer/Typer.scala | 2 +- tests/run/i5260.check | 1 + tests/run/i5260.scala | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/run/i5260.check create mode 100644 tests/run/i5260.scala diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index a2019534f989..13ee9697b3a4 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -1811,7 +1811,7 @@ class Typer extends Namer val tupleXXLobj = untpd.ref(defn.TupleXXLModule.termRef) val app = untpd.cpy.Apply(tree)(tupleXXLobj, elems1.map(untpd.TypedSplice(_))) .withPos(tree.pos) - val app1 = typed(app, pt) + val app1 = typed(app, defn.TupleXXLType) if (ctx.mode.is(Mode.Pattern)) app1 else { val elemTpes = (elems, pts).zipped.map((elem, pt) => diff --git a/tests/run/i5260.check b/tests/run/i5260.check new file mode 100644 index 000000000000..8429a626a28d --- /dev/null +++ b/tests/run/i5260.check @@ -0,0 +1 @@ +(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23) diff --git a/tests/run/i5260.scala b/tests/run/i5260.scala new file mode 100644 index 000000000000..a3dba79c606b --- /dev/null +++ b/tests/run/i5260.scala @@ -0,0 +1,8 @@ +object Test { + + def main(args: Array[String]): Unit = { + 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))) + } + + 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 +}