aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-15 18:08:10 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:12:28 +0200
commit95e488eab2a686671b2a6ffd8fce05c043b3afab (patch)
tree397e7af116478809048f82b5469e6d7101b160ca /src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
parent5a46d19dde76b739f6672c9b6f57355cfd38159a (diff)
downloaddotty-95e488eab2a686671b2a6ffd8fce05c043b3afab.tar.gz
dotty-95e488eab2a686671b2a6ffd8fce05c043b3afab.tar.bz2
dotty-95e488eab2a686671b2a6ffd8fce05c043b3afab.zip
Use BodyAnnot to indicate rhs of inline method
Since fundamental operations such as treeCopy have to know about inline bodies, it seems better to represent this information directly in an annotation.
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
}