Skip to content

Commit c46b20b

Browse files
committed
Allow override no-params java-defined methods which have a field with same name.
Fixes #9392
1 parent a7b1514 commit c46b20b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ object Denotations {
977977
true
978978
case MethodNotAMethodMatch =>
979979
// Java allows defining both a field and a zero-parameter method with the same name
980-
!ctx.erasedTypes && !(symbol.is(JavaDefined) && other.symbol.is(JavaDefined))
980+
!ctx.erasedTypes && !other.symbol.is(JavaDefined)
981981
case ParamMatch =>
982982
// The signatures do not tell us enough to be sure about matching
983983
!ctx.erasedTypes && info.matches(other.info)

0 commit comments

Comments
 (0)