@@ -323,7 +323,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
323
323
case NoType => tp
324
324
case TypeBounds (lo, hi) => if lo eq hi then recur(lo, fromBelow) else tp
325
325
case inst => recur(inst, fromBelow)
326
- case tp : TypeVar if false => // TODO: needed?
326
+ case tp : TypeVar =>
327
327
val underlying1 = recur(tp.underlying, fromBelow)
328
328
if underlying1 ne tp.underlying then underlying1 else tp
329
329
case _ => tp
@@ -399,7 +399,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
399
399
*/
400
400
def replace (param : TypeParamRef , tp : Type )(implicit ctx : Context ): OrderingConstraint =
401
401
val replacement = tp.dealiasKeepAnnots.stripTypeVar
402
- if param == replacement then this
402
+ if param == replacement then this .checkNonCyclic()
403
403
else
404
404
assert(replacement.isValueTypeOrLambda)
405
405
var current =
@@ -518,7 +518,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
518
518
val TypeParamRef (binder, n) = tvar.origin
519
519
if (binder eq tl) tvar.setOrigin(tl1.paramRefs(n))
520
520
}
521
- constr.println(i " renamd $this to $current" )
521
+ constr.println(i " renamed $this to $current" )
522
522
current.checkNonCyclic()
523
523
}
524
524
@@ -602,6 +602,8 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
602
602
case NoType =>
603
603
case TypeBounds (lo, hi) => if lo eq hi then recur(lo)
604
604
case inst => recur(inst)
605
+ case tp : TypeVar =>
606
+ recur(tp.underlying)
605
607
case TypeBounds (lo, hi) =>
606
608
recur(lo)
607
609
recur(hi)
0 commit comments