Skip to content

Commit 2548294

Browse files
committed
Fix scala#11415: always expand bounds in type approximation
1 parent 261b280 commit 2548294

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5343,14 +5343,11 @@ object Types {
53435343
def isExpandingBounds: Boolean = expandingBounds
53445344

53455345
protected def expandBounds(tp: TypeBounds): Type =
5346-
if expandingBounds then tp
5347-
else {
5348-
val saved = expandingBounds
5349-
expandingBounds = true
5350-
val res = range(atVariance(-variance)(reapply(tp.lo)), reapply(tp.hi))
5351-
expandingBounds = saved
5352-
res
5353-
}
5346+
val saved = expandingBounds
5347+
expandingBounds = true
5348+
val res = range(atVariance(-variance)(reapply(tp.lo)), reapply(tp.hi))
5349+
expandingBounds = saved
5350+
res
53545351

53555352
/** Try to widen a named type to its info relative to given prefix `pre`, where possible.
53565353
* The possible cases are listed inline in the code.

0 commit comments

Comments
 (0)