We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c589a3 + 6d43c88 commit 41605e0Copy full SHA for 41605e0
compiler/src/dotty/tools/dotc/typer/RefChecks.scala
@@ -474,14 +474,14 @@ object RefChecks {
474
* - matching names and types, but different target names
475
*/
476
override def matches(sym1: Symbol, sym2: Symbol): Boolean =
477
- sym1.isType
478
- || {
+ !(sym1.owner.is(JavaDefined, butNot = Trait) && sym2.owner.is(JavaDefined, butNot = Trait)) && // javac already handles these checks
+ (sym1.isType || {
479
val sd1 = sym1.asSeenFrom(clazz.thisType)
480
val sd2 = sym2.asSeenFrom(clazz.thisType)
481
sd1.matchesLoosely(sd2)
482
&& (sym1.hasTargetName(sym2.targetName)
483
|| compatibleTypes(sym1, sd1.info, sym2, sd2.info))
484
- }
+ })
485
end opc
486
487
while opc.hasNext do
0 commit comments