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:18:52 +1100
committerMartin Odersky <odersky@gmail.com>2017-02-01 12:18:52 +1100
commitf7278e16ffa8ff242b7d985803015170dbf80ce7 (patch)
tree21ca97e1f95e8a321b92be46ae42c25391939376 /compiler/src/dotty/tools/dotc/core/Definitions.scala
parent163d5166f17b023c63b211e2837f579c88f4f1d2 (diff)
downloaddotty-f7278e16ffa8ff242b7d985803015170dbf80ce7.tar.gz
dotty-f7278e16ffa8ff242b7d985803015170dbf80ce7.tar.bz2
dotty-f7278e16ffa8ff242b7d985803015170dbf80ce7.zip
Add explanation to NoInitClasses
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Definitions.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala
index 7eb3d9d47..18e2b883c 100644
--- a/compiler/src/dotty/tools/dotc/core/Definitions.scala
+++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala
@@ -766,6 +766,16 @@ class Definitions {
lazy val PhantomClasses = Set[Symbol](AnyClass, AnyValClass, NullClass, NothingClass)
+ /** Classes that are known not to have an initializer irrespective of
+ * whether NoInits is set. Note: FunctionXXLClass is in this set
+ * because if it is compiled by Scala2, it does not get a NoInit flag.
+ * But since it is introduced only at erasure, there's no chance
+ * for augmentScala2Traits to do anything on a class that inherits it. So
+ * it also misses an implementation class, which means that the usual scheme
+ * of calling a superclass init in the implementation class of a Scala2
+ * trait gets screwed up. Therefore, it is mandatory that FunctionXXL
+ * is treated as a NoInit trait.
+ */
lazy val NoInitClasses = PhantomClasses + FunctionXXLClass
def isPolymorphicAfterErasure(sym: Symbol) =