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.scala13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index 1b8434129..4a94e5d71 100644
--- a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -488,13 +488,12 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, posUnpickle
sym.completer.withDecls(newScope)
forkAt(templateStart).indexTemplateParams()(localContext(sym))
}
- else if (annots.exists(_.symbol == defn.InlineAnnot)) {
- 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.
- }
+ else if (annots.exists(_.symbol == defn.InlineAnnot))
+ sym.addAnnotation(LazyBodyAnnotation { ctx0 =>
+ implicit val ctx: Context = localContext(sym)(ctx0).addMode(Mode.ReadPositions)
+ // avoids space leaks by not capturing the current context
+ forkAt(rhsStart).readTerm()
+ })
goto(start)
sym
}