Skip to content

Commit 02afa11

Browse files
committed
Initialize lambda lift maps
... so that they do not spill over between compilation units. It would be better to wipe the maps after processing a compilation unit, but right now we do not have a hook for that. A better solution should be possible once we replace init by "prepareUnit/transformUnit".
1 parent 17b78ba commit 02afa11

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/dotty/tools/dotc/transform/LambdaLift.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ class LambdaLift extends MiniPhaseTransform with IdentityDenotTransformer { this
280280
}
281281

282282
override def init(implicit ctx: Context, info: TransformerInfo) = {
283+
free.clear()
284+
proxyMap.clear()
285+
called.clear()
286+
calledFromInner.clear()
287+
liftedOwner.clear()
288+
liftedDefs.clear()
283289
assert(ctx.phase == thisTransform)
284290
(new CollectDependencies).traverse(NoSymbol, ctx.compilationUnit.tpdTree)
285291
computeFreeVars()

0 commit comments

Comments
 (0)