aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/src/dotty/tools/dotc/transform/Erasure.scala4
-rw-r--r--tests/run/functionXXL.scala (renamed from tests/pos/functionXXL.scala)4
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
index 71ecb5c65..00abddd91 100644
--- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
@@ -542,7 +542,9 @@ object Erasure extends TypeTestsCasts{
* to deal with boxing and unboxing of value classes ourselves.
*/
override def typedClosure(tree: untpd.Closure, pt: Type)(implicit ctx: Context) = {
- val implClosure @ Closure(_, meth, _) = super.typedClosure(tree, pt)
+ val xxl = defn.isUnimplementedFunctionClass(tree.typeOpt.typeSymbol)
+ var implClosure @ Closure(_, meth, _) = super.typedClosure(tree, pt)
+ if (xxl) implClosure = cpy.Closure(implClosure)(tpt = TypeTree(defn.FunctionXXLType))
implClosure.tpe match {
case SAMType(sam) =>
val implType = meth.tpe.widen
diff --git a/tests/pos/functionXXL.scala b/tests/run/functionXXL.scala
index 1063e4170..de8c8e3fa 100644
--- a/tests/pos/functionXXL.scala
+++ b/tests/run/functionXXL.scala
@@ -59,12 +59,12 @@ object Test {
- println(f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ assert(42 == f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26))
- println(g(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ assert(42 == g(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26))
}