Skip to content

Commit e332bd3

Browse files
committed
Polishings and more comments
1 parent 396acbf commit e332bd3

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
@@ -4014,7 +4014,7 @@ object Types {
40144014
}
40154015

40164016
override protected def derivedAndOrType(tp: AndOrType, tp1: Type, tp2: Type) =
4017-
if (tp1.isInstanceOf[Range] || tp2.isInstanceOf[Range])
4017+
if (isRange(tp1) || isRange(tp2))
40184018
if (tp.isAnd) range(lower(tp1) & lower(tp2), upper(tp1) & upper(tp2))
40194019
else range(lower(tp1) | lower(tp2), upper(tp1) | upper(tp2))
40204020
else tp.derivedAndOrType(tp1, tp2)
@@ -4032,7 +4032,9 @@ object Types {
40324032
}
40334033

40344034
override protected def derivedClassInfo(tp: ClassInfo, pre: Type): Type = {
4035-
assert(!pre.isInstanceOf[Range])
4035+
assert(!isRange(pre))
4036+
// we don't know what to do here; this case has to be handled in subclasses
4037+
// (typically by handling ClassInfo's specially, in case they can be encountered).
40364038
tp.derivedClassInfo(pre)
40374039
}
40384040

0 commit comments

Comments
 (0)