aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/ExplicitOuter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-05 11:51:14 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:11:21 +0200
commit1d932642eaed2ec9829be951f3272d32b4393a39 (patch)
tree6e7263cc14896b604d0522f01c73644f6d54ea54 /src/dotty/tools/dotc/transform/ExplicitOuter.scala
parent0bd955e7780c95d41a0b6c4b7ca221f00e3cfd92 (diff)
downloaddotty-1d932642eaed2ec9829be951f3272d32b4393a39.tar.gz
dotty-1d932642eaed2ec9829be951f3272d32b4393a39.tar.bz2
dotty-1d932642eaed2ec9829be951f3272d32b4393a39.zip
Handle outer this in Inliner
Also, do some refactorings and fix some bugs in Inliner.
Diffstat (limited to 'src/dotty/tools/dotc/transform/ExplicitOuter.scala')
-rw-r--r--src/dotty/tools/dotc/transform/ExplicitOuter.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/src/dotty/tools/dotc/transform/ExplicitOuter.scala
index 60ef1b306..3f235dca7 100644
--- a/src/dotty/tools/dotc/transform/ExplicitOuter.scala
+++ b/src/dotty/tools/dotc/transform/ExplicitOuter.scala
@@ -57,6 +57,12 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
override def mayChange(sym: Symbol)(implicit ctx: Context): Boolean = sym.isClass
+ /** Convert a selection of the form `qual.C_<OUTER>` to an outer path from `qual` to `C` */
+ override def transformSelect(tree: Select)(implicit ctx: Context, info: TransformerInfo) =
+ if (tree.name.isOuterSelect)
+ outer.path(tree.tpe.widen.classSymbol, tree.qualifier).ensureConforms(tree.tpe)
+ else tree
+
/** First, add outer accessors if a class does not have them yet and it references an outer this.
* If the class has outer accessors, implement them.
* Furthermore, if a parent trait might have an outer accessor,