diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-09-09 16:42:03 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-09-17 18:07:15 +0200 |
commit | f0dfea49476e1b1f1d3c0f60e52e96db957dff78 (patch) | |
tree | 8f06908fd27c195549efbafb405de7ae38fd36e1 /src/dotty/tools/dotc/transform/ExplicitOuter.scala | |
parent | b22dc6d50f675ff713fd19e243f9cd439d7791b1 (diff) | |
download | dotty-f0dfea49476e1b1f1d3c0f60e52e96db957dff78.tar.gz dotty-f0dfea49476e1b1f1d3c0f60e52e96db957dff78.tar.bz2 dotty-f0dfea49476e1b1f1d3c0f60e52e96db957dff78.zip |
Changes from discussion in #171
Diffstat (limited to 'src/dotty/tools/dotc/transform/ExplicitOuter.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/ExplicitOuter.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/src/dotty/tools/dotc/transform/ExplicitOuter.scala index 669660b1f..a814f302f 100644 --- a/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -29,7 +29,7 @@ import collection.mutable * - replace outer this by outer paths. */ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransformer => - import ExplicitOuter._ + imoport ExplicitOuter._ import ast.tpd._ val Outer = new Attachment.Key[Tree] @@ -71,7 +71,10 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf /** Ensure that class `cls` has outer accessors */ def ensureOuterAccessors(cls: ClassSymbol)(implicit ctx: Context): Unit = { - if (!hasOuter(cls)) newOuterAccessors(cls).foreach(_.enteredAfter(thisTransformer)) + if (!hasOuter(cls)) { + assert(ctx.phaseId <= ctx.explicitOuter.id, "can add $outer symbols only before ExplicitOuter") + newOuterAccessors(cls).foreach(_.enteredAfter(thisTransformer)) + } } /** First, add outer accessors if a class does not have them yet and it references an outer this. |