aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-27 15:43:42 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-27 15:44:06 +0200
commita5eae5a79212f76c8a8ad3e4ea39ce0bb3302b9e (patch)
tree4c0d3a5240919568bd366972b453e225c1898e69 /src/dotty/tools/dotc/core/SymDenotations.scala
parent78f5e1cb9c0b186e4835d0a69e551ed5e988829b (diff)
downloaddotty-a5eae5a79212f76c8a8ad3e4ea39ce0bb3302b9e.tar.gz
dotty-a5eae5a79212f76c8a8ad3e4ea39ce0bb3302b9e.tar.bz2
dotty-a5eae5a79212f76c8a8ad3e4ea39ce0bb3302b9e.zip
Drop TraitConstructors phase
It did not do enough to carry its own weight, in particular because DenotationTransformers do have a price - every encountered denotation in the whole program is passed through them. The name change from <init> to $init$ was all it did, that is now rolled into Mixin. Also renamed IMPLCLASS_CONSTRUCTOR to TRAIT_CONSTRUCTOR.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index d8dddb082..78b187970 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -530,7 +530,7 @@ object SymDenotations {
final def isClassConstructor = name == nme.CONSTRUCTOR
/** Is this the constructor of a trait? */
- final def isImplClassConstructor = name == nme.IMPLCLASS_CONSTRUCTOR
+ final def isImplClassConstructor = name == nme.TRAIT_CONSTRUCTOR
/** Is this the constructor of a trait or a class */
final def isConstructor = name.isConstructorName
@@ -1630,8 +1630,11 @@ object SymDenotations {
override def fullName(implicit ctx: Context): Name = super.fullName
override def primaryConstructor(implicit ctx: Context): Symbol = {
- val cname = if (this is ImplClass) nme.IMPLCLASS_CONSTRUCTOR else nme.CONSTRUCTOR
- info.decls.denotsNamed(cname).last.symbol // denotsNamed returns Symbols in reverse order of occurrence
+ def constrNamed(cname: TermName) = info.decls.denotsNamed(cname).last.symbol
+ // denotsNamed returns Symbols in reverse order of occurrence
+ if (this.is(ImplClass)) constrNamed(nme.TRAIT_CONSTRUCTOR)
+ else
+ constrNamed(nme.CONSTRUCTOR).orElse(constrNamed(nme.TRAIT_CONSTRUCTOR))
}
/** The parameter accessors of this class. Term and type accessors,