aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/Mixin.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-11-09 10:36:37 +0100
committerMartin Odersky <odersky@gmail.com>2014-11-09 19:09:52 +0100
commitf2e3489e419a104ad5f30db68eeaf035a0f3339b (patch)
treebcb2e205a180e4c8c890360788325f44785197db /src/dotty/tools/dotc/transform/Mixin.scala
parent06c50af6551f56314f0587878035d7d7c4d8307b (diff)
downloaddotty-f2e3489e419a104ad5f30db68eeaf035a0f3339b.tar.gz
dotty-f2e3489e419a104ad5f30db68eeaf035a0f3339b.tar.bz2
dotty-f2e3489e419a104ad5f30db68eeaf035a0f3339b.zip
More docs and removing print statements
Diffstat (limited to 'src/dotty/tools/dotc/transform/Mixin.scala')
-rw-r--r--src/dotty/tools/dotc/transform/Mixin.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/Mixin.scala b/src/dotty/tools/dotc/transform/Mixin.scala
index 668aca215..1d342404a 100644
--- a/src/dotty/tools/dotc/transform/Mixin.scala
+++ b/src/dotty/tools/dotc/transform/Mixin.scala
@@ -13,10 +13,10 @@ import Decorators._
import DenotTransformers._
import StdNames._
import NameOps._
+import Phases._
import ast.Trees._
import collection.mutable
-// todo: interface
/** This phase performs the following transformations:
*
* 1. (done in `traitDefs`) Map every concrete trait getter
@@ -57,14 +57,20 @@ import collection.mutable
* 3.3 (done in `setters`) For every concrete setter `<mods> def x_=(y: T)` in M:
*
* <mods> def x_=(y: T) = ()
+ *
+ * Conceptually, this is the second half of the previous mixin phase. It needs to run
+ * after erasure because it copies references to possibly private inner classes and objects
+ * into enclosing classes where they are not visible. This can only be done if all references
+ * are symbolic.
*/
class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
import ast.tpd._
override def phaseName: String = "mixin"
-
override def treeTransformPhase = thisTransform.next
+ override def runsAfter: Set[Class[_ <: Phase]] = Set(classOf[Erasure])
+
override def transformSym(sym: SymDenotation)(implicit ctx: Context): SymDenotation =
if (sym.is(Accessor, butNot = Deferred) && sym.owner.is(Trait))
sym.copySymDenotation(initFlags = sym.flags | Deferred)