diff options
author | Martin Odersky <odersky@gmail.com> | 2014-08-27 10:48:16 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-27 10:55:47 +0200 |
commit | bfb328ff64dcfa103c91dd0cd55a617e370d6ef3 (patch) | |
tree | b7003776657a486c8fbfac43a7812b10555b0d5a /src/dotty/tools/dotc/ast/tpd.scala | |
parent | 292ce6844a212b47defc671c91396d7cec86833b (diff) | |
download | dotty-bfb328ff64dcfa103c91dd0cd55a617e370d6ef3.tar.gz dotty-bfb328ff64dcfa103c91dd0cd55a617e370d6ef3.tar.bz2 dotty-bfb328ff64dcfa103c91dd0cd55a617e370d6ef3.zip |
Make ThisTypes take TypeRefs instead of ClassSymbols
This avoids stale symbol errors and does not need the somewhat
unsystematic symbol rebinding of the last commit.
Diffstat (limited to 'src/dotty/tools/dotc/ast/tpd.scala')
-rw-r--r-- | src/dotty/tools/dotc/ast/tpd.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/ast/tpd.scala b/src/dotty/tools/dotc/ast/tpd.scala index 7bddd49f4..7208d4560 100644 --- a/src/dotty/tools/dotc/ast/tpd.scala +++ b/src/dotty/tools/dotc/ast/tpd.scala @@ -255,9 +255,9 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { def prefixIsElidable(tp: NamedType)(implicit ctx: Context) = tp.prefix match { case NoPrefix => true - case ThisType(cls) => - cls.isStaticOwner || - tp.symbol.is(ParamOrAccessor) && tp.symbol.maybeOwner.enclosingClass == cls + case pre: ThisType => + pre.cls.isStaticOwner || + tp.symbol.is(ParamOrAccessor) && tp.symbol.maybeOwner.enclosingClass == pre.cls case pre: TermRef => pre.symbol.is(Module) && pre.symbol.isStatic case _ => @@ -283,7 +283,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { def singleton(tp: Type)(implicit ctx: Context): Tree = tp match { case tp: TermRef => ref(tp) - case ThisType(cls) => This(cls) + case tp: ThisType => This(tp.cls) case SuperType(qual, _) => singleton(qual) case ConstantType(value) => Literal(value) } |