diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-31 14:40:06 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-11 09:33:12 +0200 |
commit | 24f40bc76493410f2688c8a74028ecb1db7306bf (patch) | |
tree | 1376406c3114b52c62d3350805c6c6c8323ecd7e /compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala | |
parent | a3f6ca5a5cd96e17d2f9a9c5187f45ff02b5dd61 (diff) | |
download | dotty-24f40bc76493410f2688c8a74028ecb1db7306bf.tar.gz dotty-24f40bc76493410f2688c8a74028ecb1db7306bf.tar.bz2 dotty-24f40bc76493410f2688c8a74028ecb1db7306bf.zip |
Make outer select names semantic
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala index a6e643992..c302aa61b 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -11,6 +11,7 @@ import core.Decorators._ import core.StdNames.nme import core.Names._ import core.NameOps._ +import core.NameKinds.OuterSelectName import ast.Trees._ import SymUtils._ import dotty.tools.dotc.ast.tpd @@ -61,10 +62,11 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf /** 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(start = tree.qualifier, count = tree.name.outerSelectHops) - .ensureConforms(tree.tpe) - else tree + tree.name match { + case OuterSelectName(_, nhops) => + outer.path(start = tree.qualifier, count = nhops).ensureConforms(tree.tpe) + case _ => 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. |