summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-02-08 13:10:46 -0800
committerPaul Phillips <paulp@improving.org>2013-02-08 17:41:23 -0800
commit13caa498fb856ac1de3b851ddc413e36d728c3a6 (patch)
tree798c2207e9ea108f9e9905c454aeca0e0f097355
parent22341e7ab9722cf212c01e9830014648849f8e70 (diff)
downloadscala-13caa498fb856ac1de3b851ddc413e36d728c3a6.tar.gz
scala-13caa498fb856ac1de3b851ddc413e36d728c3a6.tar.bz2
scala-13caa498fb856ac1de3b851ddc413e36d728c3a6.zip
Fix for paramaccessor alias regression.
A binary incompatibility with 2.10.0 revealed a bug I had introduced in c58647f5f2.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
-rw-r--r--test/files/run/t7106.check6
-rw-r--r--test/files/run/t7106/Analyzed_1.scala14
-rw-r--r--test/files/run/t7106/test.scala10
4 files changed, 31 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index dc5491a509..478312116a 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/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 {
diff --git a/test/files/run/t7106.check b/test/files/run/t7106.check
new file mode 100644
index 0000000000..9a4bb430fd
--- /dev/null
+++ b/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
diff --git a/test/files/run/t7106/Analyzed_1.scala b/test/files/run/t7106/Analyzed_1.scala
new file mode 100644
index 0000000000..a2ddebceed
--- /dev/null
+++ b/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
+}
diff --git a/test/files/run/t7106/test.scala b/test/files/run/t7106/test.scala
new file mode 100644
index 0000000000..3584a272db
--- /dev/null
+++ b/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)
+ }
+}