Skip to content

Commit 91e5f35

Browse files
authored
Merge pull request #8442 from dotty-staging/fix-#6635
Refine atoms computation on intersection types
2 parents be4bf7b + 11583b8 commit 91e5f35

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ enum Atoms:
2020
case Range(lo1, hi1) =>
2121
that match
2222
case Range(lo2, hi2) => Range(lo1 & lo2, hi1 & hi2)
23-
case Unknown => this
24-
case Unknown => that
23+
case Unknown => Range(Set.empty, hi1)
24+
case Unknown =>
25+
that match
26+
case Range(lo2, hi2) => Range(Set.empty, hi2)
27+
case Unknown => Unknown
2528

2629
def | (that: Atoms): Atoms = this match
2730
case Range(lo1, hi1) =>

0 commit comments

Comments
 (0)