Skip to content

Commit 13caa49

Browse files
committed
Fix for paramaccessor alias regression.
A binary incompatibility with 2.10.0 revealed a bug I had introduced in c58647f.
1 parent 22341e7 commit 13caa49

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ trait Typers extends Modes with Adaptations with Tags {
20372037
val alias = (
20382038
superAcc.initialize.alias
20392039
orElse (superAcc getter superAcc.owner)
2040-
filter (alias => superClazz.info.nonPrivateMember(alias.name) != alias)
2040+
filter (alias => superClazz.info.nonPrivateMember(alias.name) == alias)
20412041
)
20422042
if (alias.exists && !alias.accessed.isVariable) {
20432043
val ownAcc = clazz.info decl name suchThat (_.isParamAccessor) match {

test/files/run/t7106.check

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[ok] q1 I private final
2+
[ok] q3 I private final
3+
[ok] <init> (III)V public
4+
[ok] bippy1 ()I public
5+
[ok] bippy2 ()I public
6+
[ok] bippy3 ()I public
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
abstract class Base0 { def p2: Int }
3+
class Base(p1: Int, override val p2: Int) extends Base0
4+
5+
abstract class Sub1(q1: Int, q2: Int, q3: Int) extends Base(q1, q2) {
6+
def bippy1 = q1
7+
def bippy2 = q2
8+
def bippy3 = q3
9+
}
10+
abstract class Sub2(q1: Int, q2: Int, q3: Int) extends Base(q1, q2) {
11+
def bippy1 = q1
12+
def bippy2 = p2
13+
def bippy3 = q3
14+
}

test/files/run/t7106/test.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import scala.tools.partest.BytecodeTest
2+
3+
object Test extends BytecodeTest {
4+
def show {
5+
val node1 = loadClassNode("Sub1")
6+
val node2 = loadClassNode("Sub2")
7+
8+
sameMethodAndFieldSignatures(node1, node2)
9+
}
10+
}

0 commit comments

Comments
 (0)