diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 0992cd7955..f2129992e5 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -67,7 +67,10 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT case t => t } acc setInfoAndEnter (tpe cloneInfo acc) - storeAccessorDefinition(clazz, DefDef(acc, EmptyTree)) + // Diagnostic for SI-7091 + if (!accDefs.contains(clazz)) + reporter.error(sel.pos, s"Internal error: unable to store accessor definition in ${clazz}. clazz.isPackage=${clazz.isPackage}. Accessor required for ${sel} (${showRaw(sel)})") + else storeAccessorDefinition(clazz, DefDef(acc, EmptyTree)) acc } @@ -288,6 +291,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT currentClass.isTrait && sym.isProtected && sym.enclClass != currentClass + && !sym.owner.isPackageClass // SI-7091 no accessor needed package owned (ie, top level) symbols && !sym.owner.isTrait && (sym.owner.enclosingPackageClass != currentClass.enclosingPackageClass) && (qual.symbol.info.member(sym.name) ne NoSymbol) |