Browse files

Fix for paramaccessor alias regression.

A binary incompatibility with 2.10.0 revealed a bug I had
introduced in c58647f.
  • Loading branch information...
1 parent 22341e7 commit 13caa498fb856ac1de3b851ddc413e36d728c3a6 @paulp paulp committed Feb 8, 2013
View
2 src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2037,7 +2037,7 @@ trait Typers extends Modes with Adaptations with Tags {
val alias = (
superAcc.initialize.alias
orElse (superAcc getter superAcc.owner)
- filter (alias => superClazz.info.nonPrivateMember(alias.name) != alias)
+ filter (alias => superClazz.info.nonPrivateMember(alias.name) == alias)
)
if (alias.exists && !alias.accessed.isVariable) {
val ownAcc = clazz.info decl name suchThat (_.isParamAccessor) match {
View
6 test/files/run/t7106.check
@@ -0,0 +1,6 @@
+[ok] q1 I private final
+[ok] q3 I private final
+[ok] <init> (III)V public
+[ok] bippy1 ()I public
+[ok] bippy2 ()I public
+[ok] bippy3 ()I public
View
14 test/files/run/t7106/Analyzed_1.scala
@@ -0,0 +1,14 @@
+
+abstract class Base0 { def p2: Int }
+class Base(p1: Int, override val p2: Int) extends Base0
+
+abstract class Sub1(q1: Int, q2: Int, q3: Int) extends Base(q1, q2) {
+ def bippy1 = q1
+ def bippy2 = q2
+ def bippy3 = q3
+}
+abstract class Sub2(q1: Int, q2: Int, q3: Int) extends Base(q1, q2) {
+ def bippy1 = q1
+ def bippy2 = p2
+ def bippy3 = q3
+}
View
10 test/files/run/t7106/test.scala
@@ -0,0 +1,10 @@
+import scala.tools.partest.BytecodeTest
+
+object Test extends BytecodeTest {
+ def show {
+ val node1 = loadClassNode("Sub1")
+ val node2 = loadClassNode("Sub2")
+
+ sameMethodAndFieldSignatures(node1, node2)
+ }
+}

0 comments on commit 13caa49

Please sign in to comment.