Skip to content

Commit 8585325

Browse files
committed
Avoid orphan parameters in Constraint#replace
The previous implementation of `replace` made it possible that formerly constrained parameters would stay on embedded in bounds of other constraint enrties.
1 parent 5bf0df0 commit 8585325

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/core/OrderingConstraint.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
419419
def replaceIn(tp: Type, isUpper: Boolean): Type = tp match {
420420
case `param` => normalize(replacement, isUpper)
421421
case tp: AndOrType if isUpper == tp.isAnd => recombine(tp, replaceIn, isUpper)
422-
case _ => tp
422+
case _ => tp.substParam(param, replacement)
423423
}
424424

425425
bounds.derivedTypeBounds(replaceIn(lo, isUpper = false), replaceIn(hi, isUpper = true))

0 commit comments

Comments
 (0)