Skip to content

Commit 74fe6c0

Browse files
Fix #6152: Dotty tries to override Java bridge methods
Dotty overrides Java bridge methods when the user intends to override the method for which the bridge was generated. This commit forbids Dotty to override bridge methods altogether.
1 parent 574fd0c commit 74fe6c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ object OverridingPairs {
3939
* Types always match. Term symbols match if their membertypes
4040
* relative to <base>.this do
4141
*/
42-
protected def matches(sym1: Symbol, sym2: Symbol): Boolean =
43-
sym1.isType || self.memberInfo(sym1).matches(self.memberInfo(sym2))
42+
protected def matches(sym1: Symbol, sym2: Symbol): Boolean = {
43+
sym1.isType || (!sym2.is(Bridge) && self.memberInfo(sym1).matches(self.memberInfo(sym2)))
44+
}
4445

4546
/** The symbols that can take part in an overriding pair */
4647
private val decls = {

0 commit comments

Comments
 (0)