Skip to content

Commit 2c0d6df

Browse files
committed
Remove tvars in normalizedCompatible via instantiate
Use a higher-level method.
1 parent 0a04b68 commit 2c0d6df

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

+3-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ object ProtoTypes {
7373
if result && (ctx.typerState.constraint ne newctx.typerState.constraint) then
7474
// Remove all type lambdas and tvars introduced by testCompat
7575
for tvar <- newctx.typerState.ownedVars do
76-
val tl = tvar.origin.binder
77-
newctx.typerState.ownedVars -= tvar
78-
if newctx.typerState.constraint.contains(tl) then
79-
newctx.typerState.constraint = newctx.typerState.constraint.remove(tl)(using newctx)
76+
inContext(newctx):
77+
if !tvar.isInstantiated then
78+
tvar.instantiate(fromBelow = false) // any direction
8079

8180
// commit any remaining changes in typer state
8281
newctx.typerState.commit()

0 commit comments

Comments
 (0)