File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -744,7 +744,10 @@ trait Checking {
744
744
def checkDecl (decl : Symbol ): Unit = {
745
745
for (other <- seen(decl.name)) {
746
746
typr.println(i " conflict? $decl $other" )
747
- if (decl.matches(other)) {
747
+ def javaFieldMethodPair =
748
+ decl.is(JavaDefined ) && other.is(JavaDefined ) &&
749
+ decl.is(Method ) != other.is(Method )
750
+ if (decl.matches(other) && ! javaFieldMethodPair) {
748
751
def doubleDefError (decl : Symbol , other : Symbol ): Unit =
749
752
if (! decl.info.isErroneous && ! other.info.isErroneous)
750
753
ctx.error(DoubleDeclaration (decl, other), decl.sourcePos)
Original file line number Diff line number Diff line change
1
+ public class i4739 {
2
+ int foo ;
3
+ int foo () {
4
+ return this .foo ;
5
+ }
6
+ }
You can’t perform that action at this time.
0 commit comments