Skip to content

Commit

Permalink
Remove tvars in normalizedCompatible via instantiate
Browse files Browse the repository at this point in the history
Use a higher-level method.
  • Loading branch information
dwijnand committed Nov 6, 2024
1 parent 0a04b68 commit be08cec
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ object ProtoTypes {
if result && (ctx.typerState.constraint ne newctx.typerState.constraint) then
// Remove all type lambdas and tvars introduced by testCompat
for tvar <- newctx.typerState.ownedVars do
val tl = tvar.origin.binder
newctx.typerState.ownedVars -= tvar
if newctx.typerState.constraint.contains(tl) then
newctx.typerState.constraint = newctx.typerState.constraint.remove(tl)(using newctx)
inContext(newctx):
if !tvar.isInstantiated then
tvar.instantiate(fromBelow = false) // any direction

// commit any remaining changes in typer state
newctx.typerState.commit()
Expand Down

0 comments on commit be08cec

Please sign in to comment.