Skip to content

Commit baff603

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 baff603

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class ClassfileParser(
211211
if (method) Flags.Method | methodTranslation.flags(jflags)
212212
else fieldTranslation.flags(jflags)
213213
val name = pool.getName(in.nextChar)
214-
if (!(sflags is Flags.Private) || name == nme.CONSTRUCTOR) {
214+
if (!(sflags.is(Flags.Private) || sflags.is(Flags.Bridge)) || name == nme.CONSTRUCTOR) {
215215
val member = ctx.newSymbol(
216216
getOwner(jflags), name, sflags, memberCompleter, coord = start)
217217
getScope(jflags).enter(member)

0 commit comments

Comments
 (0)