Skip to content

Commit 852f99c

Browse files
dwijnandtgodzik
authored andcommitted
Remove tvars in normalizedCompatible via instantiate
Use a higher-level method. [Cherry-picked 2c0d6df]
1 parent cd21a3f commit 852f99c

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
@@ -71,10 +71,9 @@ object ProtoTypes {
7171
if result && (ctx.typerState.constraint ne newctx.typerState.constraint) then
7272
// Remove all type lambdas and tvars introduced by testCompat
7373
for tvar <- newctx.typerState.ownedVars do
74-
val tl = tvar.origin.binder
75-
newctx.typerState.ownedVars -= tvar
76-
if newctx.typerState.constraint.contains(tl) then
77-
newctx.typerState.constraint = newctx.typerState.constraint.remove(tl)(using newctx)
74+
inContext(newctx):
75+
if !tvar.isInstantiated then
76+
tvar.instantiate(fromBelow = false) // any direction
7877

7978
// commit any remaining changes in typer state
8079
newctx.typerState.commit()

0 commit comments

Comments
 (0)