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] {
511
511
constraint.entry(bound) match {
512
512
case NoType => pruneLambdaParams(bound)
513
513
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
515
520
NoType
516
- else {
517
- if (! addParamBound(bound)) NoType
518
- else if (fromBelow) defn.NothingType
519
- else defn.AnyType
520
521
}
522
+ else if (fromBelow) defn.NothingType
523
+ else defn.AnyType
521
524
case inst =>
522
525
prune(inst)
523
526
}
You can’t perform that action at this time.
0 commit comments