diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-15 18:08:10 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:12:28 +0200 |
commit | 95e488eab2a686671b2a6ffd8fce05c043b3afab (patch) | |
tree | 397e7af116478809048f82b5469e6d7101b160ca /src/dotty/tools/dotc/core/tasty/TreePickler.scala | |
parent | 5a46d19dde76b739f6672c9b6f57355cfd38159a (diff) | |
download | dotty-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/TreePickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/tasty/TreePickler.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 99a3ff85c..b6f52c0ec 100644 --- a/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -565,10 +565,11 @@ class TreePickler(pickler: TastyPickler) { sym.annotations.foreach(pickleAnnotation) } - def pickleAnnotation(ann: Annotation)(implicit ctx: Context) = { - writeByte(ANNOTATION) - withLength { pickleType(ann.symbol.typeRef); pickleTree(ann.tree) } - } + def pickleAnnotation(ann: Annotation)(implicit ctx: Context) = + if (ann.symbol != defn.BodyAnnot) { // inline bodies are reconstituted automatically when unpickling + writeByte(ANNOTATION) + withLength { pickleType(ann.symbol.typeRef); pickleTree(ann.tree) } + } def pickle(trees: List[Tree])(implicit ctx: Context) = { trees.foreach(tree => if (!tree.isEmpty) pickleTree(tree)) |