@@ -744,7 +744,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
744
744
}
745
745
746
746
def tryBaseType (cls2 : Symbol ) = {
747
- val allowBaseType = caseLambda.eq( NoType ) || (tp1 match {
747
+ val allowBaseType = ! caseLambda.exists || (tp1 match {
748
748
case tp : TypeRef if tp.symbol.isClass => true
749
749
case AppliedType (tycon : TypeRef , _) if tycon.symbol.isClass => true
750
750
case _ => false
@@ -769,7 +769,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
769
769
|| narrowGADTBounds(tp1, tp2, approx, isUpper = true ))
770
770
&& (tp2.isAny || GADTusage (tp1.symbol))
771
771
772
- caseLambda.eq( NoType ) && isSubType(hi1, tp2, approx.addLow) || compareGADT || tryLiftedToThis1
772
+ ! caseLambda.exists && isSubType(hi1, tp2, approx.addLow) || compareGADT || tryLiftedToThis1
773
773
case _ =>
774
774
// `Mode.RelaxedOverriding` is only enabled when checking Java overriding
775
775
// in explicit nulls, and `Null` becomes a bottom type, which allows
@@ -2540,7 +2540,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
2540
2540
def fullyInstantiated (tp : Type ): Boolean = new TypeAccumulator [Boolean ] {
2541
2541
override def apply (x : Boolean , t : Type ) =
2542
2542
x && {
2543
- t match {
2543
+ t.dealias match {
2544
2544
case tp : TypeRef if ! tp.symbol.isClass => false
2545
2545
case _ : SkolemType | _ : TypeVar | _ : TypeParamRef => false
2546
2546
case _ => foldOver(x, t)
0 commit comments