Skip to content

Commit b836bf4

Browse files
committed
Compensate for getter transform in isSubType test
Getters transform `T` to `=> T`. This means that `=> T <: T` might need to be true after getters. Observed in the wild tree checking t938.scala after getters.
1 parent 58e34e8 commit b836bf4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
488488
case _ => tp2 isRef ObjectClass
489489
}
490490
compareJavaArray
491+
case tp1: ExprType if ctx.phase.id >= ctx.gettersPhase.id =>
492+
// getters might have converted T to => T, need to compensate.
493+
isSubType(tp1.widenExpr, tp2)
491494
case _ =>
492495
false
493496
}

0 commit comments

Comments
 (0)