Skip to content

Commit

Permalink
Change level checking and instantiation for invariantly occurring Typ…
Browse files Browse the repository at this point in the history
…eVars

Also instantiate them to their lower bounds, instead of updating the level.
It's a trial balloon.
  • Loading branch information
odersky committed Aug 18, 2022
1 parent 4649fd9 commit 418b9bd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ trait ConstraintHandling {
val inst = tp.instanceOpt
if inst.exists then apply(need, inst)
else if tp.nestingLevel > maxLevel then
if variance > 0 then nestedVarsLo += tp
if variance >= 0 then nestedVarsLo += tp
else if variance < 0 then nestedVarsHi += tp
else tp.nestingLevel = maxLevel
// For invariant type variables, we use a different strategy.
Expand Down

0 comments on commit 418b9bd

Please sign in to comment.