diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 7a2722547531..7cae7a905ad5 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -1579,9 +1579,9 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling finally canCompareAtoms = true result - tp2.atoms match + tp2.normalized.atoms match case Atoms.Range(lo2, hi2) if canCompareAtoms && canCompare(hi2) => - tp1.atoms match + tp1.normalized.atoms match case Atoms.Range(lo1, hi1) => if hi1.subsetOf(lo2) || knownSingletons && hi2.size == 1 && hi1 == hi2 then Some(verified(true)) @@ -1589,11 +1589,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling Some(verified(false)) else None - case Atoms.Unknown => - if knownSingletons then - Some(verified(recur(tp1, NothingType))) - else - None + case _ => Some(verified(recur(tp1, NothingType))) case _ => None /** Subtype test for corresponding arguments in `args1`, `args2` according to