@@ -11,6 +11,7 @@ import config.Config
1111import config .Printers .constr
1212import reflect .ClassTag
1313import Constraint .ReverseDeps
14+ import Substituters .SubstParamMap
1415import annotation .tailrec
1516import annotation .internal .sharable
1617import cc .{CapturingType , derivedCapturingType }
@@ -411,7 +412,6 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
411412 tvars.copyToArray(entries1, nparams)
412413 newConstraint(boundsMap = this .boundsMap.updated(poly, entries1))
413414 .init(poly)
414- .adjustDeps(poly, entries1, add = true )
415415 }
416416
417417 /** Split dependent parameters off the bounds for parameters in `poly`.
@@ -433,7 +433,8 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
433433 todos.dropInPlace(1 )
434434 i += 1
435435 }
436- current.checkWellFormed()
436+ current.adjustDeps(poly, current.boundsMap(poly).nn, add = true )
437+ .checkWellFormed()
437438 }
438439
439440// ---------- Updates ------------------------------------------------------------
@@ -609,11 +610,10 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
609610 current = lowerLens.map(this , current, hi, removeParam)
610611
611612 current.foreachParam { (p, i) =>
612- current = boundsLens.map(this , current, p, i,
613- entry =>
614- val newEntry = replaceParam(entry, p, i)
615- adjustDeps(newEntry, entry, p.paramRefs(i))
616- newEntry)
613+ val other = p.paramRefs(i)
614+ val oldEntry = current.entry(other)
615+ val newEntry = current.ensureNonCyclic(other, oldEntry.substParam(param, replacement))
616+ current = updateEntryNoOrdering(current, other, newEntry, oldEntry)
617617 }
618618 current.dropDeps(param)
619619 current.checkWellFormed()
0 commit comments