@@ -341,24 +341,22 @@ trait ConstraintHandling {
341
341
* and propagate all bounds.
342
342
* @param tvars See Constraint#add
343
343
*/
344
- def addToConstraint (tl : TypeLambda , tvars : List [TypeVar ]): Unit =
345
- assert {
346
- checkPropagated(i " initialized $tl" ) {
347
- constraint = constraint.add(tl, tvars)
348
- tl.paramRefs.forall { param =>
349
- constraint.entry(param) match {
350
- case bounds : TypeBounds =>
351
- val lower = constraint.lower(param)
352
- val upper = constraint.upper(param)
353
- if (lower.nonEmpty && ! bounds.lo.isRef(defn.NothingClass ) ||
354
- upper.nonEmpty && ! bounds.hi.isRef(defn.AnyClass )) constr.println(i " INIT*** $tl" )
355
- lower.forall(addOneBound(_, bounds.hi, isUpper = true )) &&
356
- upper.forall(addOneBound(_, bounds.lo, isUpper = false ))
357
- case _ =>
358
- // Happens if param was already solved while processing earlier params of the same TypeLambda.
359
- // See #4720.
360
- true
361
- }
344
+ def addToConstraint (tl : TypeLambda , tvars : List [TypeVar ]): Boolean =
345
+ checkPropagated(i " initialized $tl" ) {
346
+ constraint = constraint.add(tl, tvars)
347
+ tl.paramRefs.forall { param =>
348
+ constraint.entry(param) match {
349
+ case bounds : TypeBounds =>
350
+ val lower = constraint.lower(param)
351
+ val upper = constraint.upper(param)
352
+ if (lower.nonEmpty && ! bounds.lo.isRef(defn.NothingClass ) ||
353
+ upper.nonEmpty && ! bounds.hi.isRef(defn.AnyClass )) constr.println(i " INIT*** $tl" )
354
+ lower.forall(addOneBound(_, bounds.hi, isUpper = true )) &&
355
+ upper.forall(addOneBound(_, bounds.lo, isUpper = false ))
356
+ case _ =>
357
+ // Happens if param was already solved while processing earlier params of the same TypeLambda.
358
+ // See #4720.
359
+ true
362
360
}
363
361
}
364
362
}
0 commit comments