Skip to content

Commit 6e08737

Browse files
committed
Polishings and more comments
1 parent 8d17f57 commit 6e08737

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
@@ -4021,7 +4021,7 @@ object Types {
40214021
}
40224022

40234023
override protected def derivedAndOrType(tp: AndOrType, tp1: Type, tp2: Type) =
4024-
if (tp1.isInstanceOf[Range] || tp2.isInstanceOf[Range])
4024+
if (isRange(tp1) || isRange(tp2))
40254025
if (tp.isAnd) range(lower(tp1) & lower(tp2), upper(tp1) & upper(tp2))
40264026
else range(lower(tp1) | lower(tp2), upper(tp1) | upper(tp2))
40274027
else tp.derivedAndOrType(tp1, tp2)
@@ -4039,7 +4039,9 @@ object Types {
40394039
}
40404040

40414041
override protected def derivedClassInfo(tp: ClassInfo, pre: Type): Type = {
4042-
assert(!pre.isInstanceOf[Range])
4042+
assert(!isRange(pre))
4043+
// we don't know what to do here; this case has to be handled in subclasses
4044+
// (typically by handling ClassInfo's specially, in case they can be encountered).
40434045
tp.derivedClassInfo(pre)
40444046
}
40454047

0 commit comments

Comments
 (0)