Permalink
Browse files

SI-7091 Don't try to put a protected accessor in a package.

This shows up when a protected[pack] class has a constructor
with a default argument.

Regressed in f708b87 / SI-2296.
  • Loading branch information...
1 parent 2e8ede5 commit 6a7d793388628d9e8d20c59cc327843f33615db0 @retronym retronym committed Feb 10, 2013
Showing with 8 additions and 0 deletions.
  1. +1 −0 src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
  2. +7 −0 test/files/pos/t7091.scala
@@ -291,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)
@@ -0,0 +1,7 @@
+package p1.p2
+
+protected[p2] class C(var x: Int = 0)
+
+protected[p2] trait T {
+ new C()
+}

0 comments on commit 6a7d793

Please sign in to comment.