Skip to content

Commit fe94bc7

Browse files
committed
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.
1 parent be46e48 commit fe94bc7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
19011901
if (sym.isInterface) ACC_INTERFACE else 0,
19021902
if (finalFlag) ACC_FINAL else 0,
19031903
if (sym.isStaticMember) ACC_STATIC else 0,
1904-
if (sym.isBridge || sym.hasFlag(Flags.MIXEDIN) && sym.isMethod) ACC_BRIDGE else 0,
1904+
if (sym.isBridge) ACC_BRIDGE else 0,
19051905
if (sym.isClass && !sym.isInterface) ACC_SUPER else 0,
19061906
if (sym.isVarargsMethod) ACC_VARARGS else 0
19071907
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
trait Foo {
2+
def getFoo() = "foo"
3+
}
4+
5+
class Sub extends Foo {
6+
def getBar() = "bar"
7+
}
8+
9+
object Test {
10+
def main(args: Array[String]): Unit = {
11+
val ms = classOf[Sub].getDeclaredMethods
12+
assert(ms forall (x => !x.isBridge), ms mkString " ")
13+
}
14+
}

0 commit comments

Comments
 (0)