File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -644,7 +644,14 @@ trait Contexts { self: Analyzer =>
644644 new ImplicitInfo (sym.name, pre, sym)
645645
646646 private def collectImplicitImports (imp : ImportInfo ): List [ImplicitInfo ] = {
647- val pre = imp.qual.tpe
647+ val qual = imp.qual
648+
649+ val pre =
650+ if (qual.tpe.typeSymbol.isPackageClass)
651+ // SI-6225 important if the imported symbol is inherited by the the package object.
652+ singleType(qual.tpe, qual.tpe member nme.PACKAGE )
653+ else
654+ qual.tpe
648655 def collect (sels : List [ImportSelector ]): List [ImplicitInfo ] = sels match {
649656 case List () =>
650657 List ()
Original file line number Diff line number Diff line change 1+
2+ package library .x {
3+ class X {
4+ class Foo
5+ implicit val foo : Foo = new Foo
6+ }
7+ }
8+ package library {
9+ package object y extends library.x.X
10+ }
11+
12+ object ko {
13+ import library .y .{Foo , foo }
14+ implicitly[Foo ]
15+ }
16+
17+ object ko2 {
18+ import library .y ._
19+ implicitly[Foo ]
20+ }
You can’t perform that action at this time.
0 commit comments