From 163d5166f17b023c63b211e2837f579c88f4f1d2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 1 Feb 2017 12:09:39 +1100 Subject: Make it known that FunctionXXL does not have an initializer. When compiled from Scala2 that knowledge was lost. Normally that would be not a problem (e.g. the same thing happens for Function0-22). But FunctionXXL is special in that it is inherited only after erasure. Since `augmentScala2Trait` runs before erasure, it is having no effect on FunctionXXL itself when running on classes that inherit function types of large arities. Therefore, FunctionXXL is missing an implementation class at phase Mixin, which means that the supercall logic which rewires super. to implementation class init cannot work. This leaves us with a super. to FunctionXXL in `i1915.scala`. The fix is to always know that `FunctionXXL` has no init method, so no super. will be generated for it. --- compiler/src/dotty/tools/dotc/transform/Mixin.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/src/dotty/tools/dotc/transform') diff --git a/compiler/src/dotty/tools/dotc/transform/Mixin.scala b/compiler/src/dotty/tools/dotc/transform/Mixin.scala index 27cfc835a..fd4370d3e 100644 --- a/compiler/src/dotty/tools/dotc/transform/Mixin.scala +++ b/compiler/src/dotty/tools/dotc/transform/Mixin.scala @@ -175,7 +175,7 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform => case Some(call) => if (defn.PhantomClasses.contains(baseCls)) Nil else call :: Nil case None => - if (baseCls.is(NoInitsTrait) || defn.PhantomClasses.contains(baseCls)) Nil + if (baseCls.is(NoInitsTrait) || defn.NoInitClasses.contains(baseCls)) Nil else { //println(i"synth super call ${baseCls.primaryConstructor}: ${baseCls.primaryConstructor.info}") transformFollowingDeep(superRef(baseCls.primaryConstructor).appliedToNone) :: Nil -- cgit v1.2.3