From c0ca8e98ace0f72fea5dcfa21c2c739b0cc9cb76 Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Wed, 30 Mar 2022 16:30:29 +0200 Subject: [PATCH] Address review --- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 70d0a400aac3..c24ad5f0c05b 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -744,7 +744,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling } def tryBaseType(cls2: Symbol) = { - val allowBaseType = caseLambda.eq(NoType) || (tp1 match { + val allowBaseType = !caseLambda.exists || (tp1 match { case tp: TypeRef if tp.symbol.isClass => true case AppliedType(tycon: TypeRef, _) if tycon.symbol.isClass => true case _ => false @@ -769,7 +769,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling || narrowGADTBounds(tp1, tp2, approx, isUpper = true)) && (tp2.isAny || GADTusage(tp1.symbol)) - caseLambda.eq(NoType) && isSubType(hi1, tp2, approx.addLow) || compareGADT || tryLiftedToThis1 + !caseLambda.exists && isSubType(hi1, tp2, approx.addLow) || compareGADT || tryLiftedToThis1 case _ => // `Mode.RelaxedOverriding` is only enabled when checking Java overriding // in explicit nulls, and `Null` becomes a bottom type, which allows @@ -2540,7 +2540,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling def fullyInstantiated(tp: Type): Boolean = new TypeAccumulator[Boolean] { override def apply(x: Boolean, t: Type) = x && { - t match { + t.dealias match { case tp: TypeRef if !tp.symbol.isClass => false case _: SkolemType | _: TypeVar | _: TypeParamRef => false case _ => foldOver(x, t)