Skip to content

Commit 446240b

Browse files
committed
Normalize types in compareAtoms
1 parent 3a49d59 commit 446240b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,21 +1579,17 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
15791579
finally canCompareAtoms = true
15801580
result
15811581

1582-
tp2.atoms match
1582+
tp2.normalized.atoms match
15831583
case Atoms.Range(lo2, hi2) if canCompareAtoms && canCompare(hi2) =>
1584-
tp1.atoms match
1584+
tp1.normalized.atoms match
15851585
case Atoms.Range(lo1, hi1) =>
15861586
if hi1.subsetOf(lo2) || knownSingletons && hi2.size == 1 && hi1 == hi2 then
15871587
Some(verified(true))
15881588
else if !lo1.subsetOf(hi2) then
15891589
Some(verified(false))
15901590
else
15911591
None
1592-
case Atoms.Unknown =>
1593-
if knownSingletons then
1594-
Some(verified(recur(tp1, NothingType)))
1595-
else
1596-
None
1592+
case _ => Some(verified(recur(tp1, NothingType)))
15971593
case _ => None
15981594

15991595
/** Subtype test for corresponding arguments in `args1`, `args2` according to

0 commit comments

Comments
 (0)