Skip to content

Backport "Remove tvars introduced while testing normalizedCompatible" to 3.3 LTS #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove tvars in normalizedCompatible via instantiate
Use a higher-level method.

[Cherry-picked 2c0d6df]
  • Loading branch information
dwijnand authored and tgodzik committed Feb 17, 2025
commit 852f99c46c20e84f96cc48fc421a3f079240abd8
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 @@ -71,10 +71,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
Loading