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.
1 parent 2b333ba commit 825f7ebCopy full SHA for 825f7eb
compiler/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -371,7 +371,10 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
371
val cls2 = tp2.symbol
372
if (cls2.isClass) {
373
val base = tp1.baseType(cls2)
374
- if (base.exists && (base ne tp1)) return isSubType(base, tp2)
+ if (base.exists) {
375
+ if (cls2.is(JavaDefined)) return base.typeSymbol == cls2
376
+ if (base ne tp1) return isSubType(base, tp2)
377
+ }
378
if (cls2 == defn.SingletonClass && tp1.isStable) return true
379
}
380
fourthTry(tp1, tp2)
0 commit comments