summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-05 11:38:44 -0800
committerPaul Phillips <paulp@improving.org>2012-01-05 12:06:52 -0800
commitfe94bc7a144921f6c3dcbedbedd2c5c884a77bbd (patch)
tree3610cfc3662e4b1cd859129b1190f8a6e7d550b5
parentbe46e487134305edae065de00582928c120bcfbb (diff)
downloadscala-fe94bc7a144921f6c3dcbedbedd2c5c884a77bbd.tar.gz
scala-fe94bc7a144921f6c3dcbedbedd2c5c884a77bbd.tar.bz2
scala-fe94bc7a144921f6c3dcbedbedd2c5c884a77bbd.zip
Don't mark mixed in methods as bridges.
Sometime during the signature-related chaos before 2.9.1, genjvm was modified to pin ACC_BRIDGE onto mixed-in methods. This isn't necessary to suppress the signature (which has already happened at that point) and has deleterious effects since many tools ignore bridge methods. Review by @odersky.
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala2
-rw-r--r--test/files/run/mixin-bridge-methods.scala14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index ff98537907..241163885d 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -1901,7 +1901,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
if (sym.isInterface) ACC_INTERFACE else 0,
if (finalFlag) ACC_FINAL else 0,
if (sym.isStaticMember) ACC_STATIC else 0,
- if (sym.isBridge || sym.hasFlag(Flags.MIXEDIN) && sym.isMethod) ACC_BRIDGE else 0,
+ if (sym.isBridge) ACC_BRIDGE else 0,
if (sym.isClass && !sym.isInterface) ACC_SUPER else 0,
if (sym.isVarargsMethod) ACC_VARARGS else 0
)
diff --git a/test/files/run/mixin-bridge-methods.scala b/test/files/run/mixin-bridge-methods.scala
new file mode 100644
index 0000000000..e0340ebb12
--- /dev/null
+++ b/test/files/run/mixin-bridge-methods.scala
@@ -0,0 +1,14 @@
+trait Foo {
+ def getFoo() = "foo"
+}
+
+class Sub extends Foo {
+ def getBar() = "bar"
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val ms = classOf[Sub].getDeclaredMethods
+ assert(ms forall (x => !x.isBridge), ms mkString " ")
+ }
+}