diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-05 11:38:44 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-27 08:58:11 -0800 |
commit | 08546b59a076231f3a96f89a9c9a4e448126c2a5 (patch) | |
tree | 5936ae8c9f279fe65528bc14c9f950e819613ce8 | |
parent | 29f3eace1e1ed388ae6553c6b7aceb279e585848 (diff) | |
download | scala-08546b59a076231f3a96f89a9c9a4e448126c2a5.tar.gz scala-08546b59a076231f3a96f89a9c9a4e448126c2a5.tar.bz2 scala-08546b59a076231f3a96f89a9c9a4e448126c2a5.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.scala | 2 | ||||
-rw-r--r-- | test/files/run/mixin-bridge-methods.scala | 14 |
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 de8fa14a13..029d3f2ae6 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -1860,7 +1860,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with if (sym.isInterface) ACC_INTERFACE else 0, if (sym.isFinal && !sym.enclClass.isInterface && !sym.isClassConstructor) 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 " ") + } +} |