aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index b148cced5..1b8434129 100644
--- a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -489,8 +489,11 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, posUnpickle
forkAt(templateStart).indexTemplateParams()(localContext(sym))
}
else if (annots.exists(_.symbol == defn.InlineAnnot)) {
- val inlineCtx = localContext(sym).addMode(Mode.ReadPositions)
- Inliner.registerInlineInfo(sym, implicit ctx => forkAt(rhsStart).readTerm())(inlineCtx)
+ Inliner.registerInlineInfo(
+ sym,
+ implicit ctx => forkAt(rhsStart).readTerm(),
+ implicit ctx => localContext(sym).addMode(Mode.ReadPositions))
+ // Previous line avoids space leaks because it does not capture the current context.
}
goto(start)
sym