summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-02-08 23:53:18 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-02-09 00:01:52 +0100
commit451cab967a332773c2027ada7553d5d59c0dc4b1 (patch)
tree1b7786d0ab350aec3113c496e0366f5f174e7304 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parent6537d79e47def868e028815db6f70e2dc7d49bac (diff)
downloadscala-451cab967a332773c2027ada7553d5d59c0dc4b1.tar.gz
scala-451cab967a332773c2027ada7553d5d59c0dc4b1.tar.bz2
scala-451cab967a332773c2027ada7553d5d59c0dc4b1.zip
SI-6225 Fix import of inherited package object implicits
The prefix in the ImplicitInfo must be com.acme.`package`.type, rather than com.acme.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 620665126e..f2a2ef4d61 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -644,7 +644,14 @@ trait Contexts { self: Analyzer =>
new ImplicitInfo(sym.name, pre, sym)
private def collectImplicitImports(imp: ImportInfo): List[ImplicitInfo] = {
- val pre = imp.qual.tpe
+ val qual = imp.qual
+
+ val pre =
+ if (qual.tpe.typeSymbol.isPackageClass)
+ // SI-6225 important if the imported symbol is inherited by the the package object.
+ singleType(qual.tpe, qual.tpe member nme.PACKAGE)
+ else
+ qual.tpe
def collect(sels: List[ImportSelector]): List[ImplicitInfo] = sels match {
case List() =>
List()