Skip to content

Commit 418b9bd

Browse files
committed
Change level checking and instantiation for invariantly occurring TypeVars
Also instantiate them to their lower bounds, instead of updating the level. It's a trial balloon.
1 parent 4649fd9 commit 418b9bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ trait ConstraintHandling {
499499
val inst = tp.instanceOpt
500500
if inst.exists then apply(need, inst)
501501
else if tp.nestingLevel > maxLevel then
502-
if variance > 0 then nestedVarsLo += tp
502+
if variance >= 0 then nestedVarsLo += tp
503503
else if variance < 0 then nestedVarsHi += tp
504504
else tp.nestingLevel = maxLevel
505505
// For invariant type variables, we use a different strategy.

0 commit comments

Comments
 (0)