File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -511,13 +511,16 @@ trait ConstraintHandling[AbstractContext] {
511511 constraint.entry(bound) match {
512512 case NoType => pruneLambdaParams(bound)
513513 case _ : TypeBounds =>
514- if (ctx.mode.is(Mode .ConstrainResult ))
514+ val savedConstraint = constraint
515+ val added = addParamBound(bound)
516+ if (! added)
517+ NoType
518+ else if (constraint != savedConstraint && ctx.mode.is(Mode .ConstrainResult )) {
519+ constraint = savedConstraint
515520 NoType
516- else {
517- if (! addParamBound(bound)) NoType
518- else if (fromBelow) defn.NothingType
519- else defn.AnyType
520521 }
522+ else if (fromBelow) defn.NothingType
523+ else defn.AnyType
521524 case inst =>
522525 prune(inst)
523526 }
You can’t perform that action at this time.
0 commit comments