aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-12-17 17:19:04 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-12-17 17:42:01 +0100
commit0a6461812aa5803726a8607546668f624987b140 (patch)
tree85c09e7626752bcc7938524a44c66cec536c97af /src/dotty/tools/dotc/core/TypeOps.scala
parent6eaf815923e194cd4d0da8faa0f132dbf8de4608 (diff)
downloaddotty-0a6461812aa5803726a8607546668f624987b140.tar.gz
dotty-0a6461812aa5803726a8607546668f624987b140.tar.bz2
dotty-0a6461812aa5803726a8607546668f624987b140.zip
Simplified and commented makePackageObjPrefixExplicit
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 4716d89b7..260e2f6d6 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -224,9 +224,14 @@ trait TypeOps { this: Context =>
cls.enter(sym, decls)
}
- def makePackageObjPrefixExplicit(tpe: NamedType, d: Denotation): Type = {
+ /** If `tpe` is of the form `p.x` where `p` refers to a package
+ * but `x` is not owned by a package, expand it to
+ *
+ * p.package.x
+ */
+ def makePackageObjPrefixExplicit(tpe: NamedType): Type = {
def tryInsert(pkgClass: SymDenotation): Type = pkgClass match {
- case pkgCls: PackageClassDenotation if !(d.symbol.maybeOwner is Package) =>
+ case pkgCls: PackageClassDenotation if !(tpe.symbol.maybeOwner is Package) =>
tpe.derivedSelect(pkgCls.packageObj.valRef)
case _ =>
tpe