aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/Definitions.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-01 12:09:39 +1100
committerMartin Odersky <odersky@gmail.com>2017-02-01 12:09:39 +1100
commit163d5166f17b023c63b211e2837f579c88f4f1d2 (patch)
treeaa25472f984636b8cc37850586e534af823ae401 /compiler/src/dotty/tools/dotc/core/Definitions.scala
parent12d11cb8c2c38f7eb1c50fb577717c75f6895f00 (diff)
downloaddotty-163d5166f17b023c63b211e2837f579c88f4f1d2.tar.gz
dotty-163d5166f17b023c63b211e2837f579c88f4f1d2.tar.bz2
dotty-163d5166f17b023c63b211e2837f579c88f4f1d2.zip
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.<init> to implementation class init cannot work. This leaves us with a super.<init> to FunctionXXL in `i1915.scala`. The fix is to always know that `FunctionXXL` has no init method, so no super.<init> will be generated for it.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Definitions.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala
index 461773295..7eb3d9d47 100644
--- a/compiler/src/dotty/tools/dotc/core/Definitions.scala
+++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala
@@ -766,6 +766,8 @@ class Definitions {
lazy val PhantomClasses = Set[Symbol](AnyClass, AnyValClass, NullClass, NothingClass)
+ lazy val NoInitClasses = PhantomClasses + FunctionXXLClass
+
def isPolymorphicAfterErasure(sym: Symbol) =
(sym eq Any_isInstanceOf) || (sym eq Any_asInstanceOf)