diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-17 17:13:30 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-12-17 17:42:01 +0100 |
commit | 6eaf815923e194cd4d0da8faa0f132dbf8de4608 (patch) | |
tree | f3a76f8bb60353cac118c40d029a8ac72d1a5615 /src/dotty/tools/dotc/TypeErasure.scala | |
parent | 48966b403a638201e7d174f96176351385f85ac7 (diff) | |
download | dotty-6eaf815923e194cd4d0da8faa0f132dbf8de4608.tar.gz dotty-6eaf815923e194cd4d0da8faa0f132dbf8de4608.tar.bz2 dotty-6eaf815923e194cd4d0da8faa0f132dbf8de4608.zip |
Refactored common behavior from TypeAssigner and TypeErasure
Diffstat (limited to 'src/dotty/tools/dotc/TypeErasure.scala')
-rw-r--r-- | src/dotty/tools/dotc/TypeErasure.scala | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/TypeErasure.scala b/src/dotty/tools/dotc/TypeErasure.scala index 13c8b4df7..9f9894c57 100644 --- a/src/dotty/tools/dotc/TypeErasure.scala +++ b/src/dotty/tools/dotc/TypeErasure.scala @@ -108,11 +108,9 @@ object TypeErasure { def erasedRef(tp: Type)(implicit ctx: Context): Type = tp match { case tp: TermRef => assert(tp.symbol.exists, tp) - if(tp.prefix.widenDealias.classSymbol.is(Flags.Package) && !tp.termSymbol.owner.is(Flags.Package)) - // we are accessing a definition inside a package object - TermRef(erasedRef(tp.prefix).member(nme.PACKAGE).asSymDenotation.termRef, tp.symbol.asTerm) - else - TermRef(erasedRef(tp.prefix), tp.symbol.asTerm) + val tp1 = ctx.makePackageObjPrefixExplicit(tp, tp.symbol) + if (tp1 ne tp) erasedRef(tp1) + else TermRef(erasedRef(tp.prefix), tp.symbol.asTerm) case tp: ThisType => tp case tp => |