aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-12-15 12:57:13 +0100
committerMartin Odersky <odersky@gmail.com>2014-12-15 12:58:22 +0100
commit413bcebf5a87102b1f1b2840b92b6a8017aa16df (patch)
treeb3fe9788ef0a28e5d213be1c761f8838530dfc48 /src/dotty/tools/dotc/core/TypeOps.scala
parent9bc3bb2d1fe3348bc7a92e5cb38a7d9f77166a71 (diff)
downloaddotty-413bcebf5a87102b1f1b2840b92b6a8017aa16df.tar.gz
dotty-413bcebf5a87102b1f1b2840b92b6a8017aa16df.tar.bz2
dotty-413bcebf5a87102b1f1b2840b92b6a8017aa16df.zip
Fix to asSeenFrom for package object members
Like TypeAssigner, asSeenFrom needs to insert a package object if the prefix is a package but the class enclosing the type is not.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 7b76feb4d..2b129ebf5 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -22,6 +22,8 @@ trait TypeOps { this: Context =>
case SuperType(thispre, _) => thispre
case _ => pre
}
+ else if ((pre.termSymbol is Package) && !(thiscls is Package))
+ toPrefix(pre.select(nme.PACKAGE), cls, thiscls)
else
toPrefix(pre.baseTypeRef(cls).normalizedPrefix, cls.owner, thiscls)
}