diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 7ae2ce7bb1..3563247e75 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -408,7 +408,9 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT if (res) { val host = hostForAccessorOf(sym, currentOwner.enclClass) - if (host.thisSym != host) { + // bug #1393 - as things stand now the "host" could be a package. + if (host.isPackageClass) false + else if (host.thisSym != host) { if (host.thisSym.tpe.typeSymbol.hasFlag(JAVA)) errorRestriction(currentOwner.enclClass + " accesses protected " + sym + " from self type " + host.thisSym.tpe) |