Skip to content

Commit 742a2d9

Browse files
committed
Polishings and more comments
1 parent 1440b25 commit 742a2d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4017,7 +4017,7 @@ object Types {
40174017
}
40184018

40194019
override protected def derivedAndOrType(tp: AndOrType, tp1: Type, tp2: Type) =
4020-
if (tp1.isInstanceOf[Range] || tp2.isInstanceOf[Range])
4020+
if (isRange(tp1) || isRange(tp2))
40214021
if (tp.isAnd) range(lower(tp1) & lower(tp2), upper(tp1) & upper(tp2))
40224022
else range(lower(tp1) | lower(tp2), upper(tp1) | upper(tp2))
40234023
else tp.derivedAndOrType(tp1, tp2)
@@ -4035,7 +4035,9 @@ object Types {
40354035
}
40364036

40374037
override protected def derivedClassInfo(tp: ClassInfo, pre: Type): Type = {
4038-
assert(!pre.isInstanceOf[Range])
4038+
assert(!isRange(pre))
4039+
// we don't know what to do here; this case has to be handled in subclasses
4040+
// (typically by handling ClassInfo's specially, in case they can be encountered).
40394041
tp.derivedClassInfo(pre)
40404042
}
40414043

0 commit comments

Comments
 (0)