diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t9326a.scala | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index d5a3fba76f..25c800e4d0 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -956,7 +956,7 @@ trait Contexts { self: Analyzer => * it selected from a prefix with `pkg` as its type symbol? */ def isInPackageObject(sym: Symbol, pkg: Symbol): Boolean = - pkg.isPackage && sym.owner != pkg + pkg.isPackage && sym.owner != pkg && !sym.isExistentiallyBound def isNameInScope(name: Name) = lookupSymbol(name, _ => true).isSuccess diff --git a/test/files/pos/t9326a.scala b/test/files/pos/t9326a.scala new file mode 100644 index 0000000000..aefc735585 --- /dev/null +++ b/test/files/pos/t9326a.scala @@ -0,0 +1,6 @@ +package p + +trait M[A] + +class C extends M[Tuple1[X] forSome { type X }] + |