diff options
author | Martin Odersky <odersky@gmail.com> | 2016-10-17 15:49:42 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-17 15:51:22 +0200 |
commit | 6ce403eb0c6b630f925db38b7538e0f9b8c892ea (patch) | |
tree | 1a395799f4aeee5a7295378c361966566c8c35ab /src/dotty/tools/dotc/core/tasty/TreePickler.scala | |
parent | 2fe0f674124c5be064d1cbf80594fb8e7d5d78be (diff) | |
download | dotty-6ce403eb0c6b630f925db38b7538e0f9b8c892ea.tar.gz dotty-6ce403eb0c6b630f925db38b7538e0f9b8c892ea.tar.bz2 dotty-6ce403eb0c6b630f925db38b7538e0f9b8c892ea.zip |
Pickle Inlined trees
Inlined trees should be preserved by pickling so that we keep
positions accurate.
With that change now all tasty tests are tested for position
accuracy.
Diffstat (limited to 'src/dotty/tools/dotc/core/tasty/TreePickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/tasty/TreePickler.scala | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/src/dotty/tools/dotc/core/tasty/TreePickler.scala index a5f421888..7f1895cc3 100644 --- a/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -438,15 +438,10 @@ class TreePickler(pickler: TastyPickler) { case SeqLiteral(elems, elemtpt) => writeByte(REPEATED) withLength { pickleTree(elemtpt); elems.foreach(pickleTree) } - case tree: Inlined => - // Why drop Inlined info when pickling? - // Since we never inline inside an inlined method, we know that - // any code that continas an Inlined tree is not inlined itself. - // So position information for inline expansion is no longer needed. - // The only reason to keep the inline info around would be to have fine-grained - // position information in the linker. We should come back to this - // point once we know more what we would do with such information. - pickleTree(Inliner.dropInlined(tree)) + case Inlined(call, bindings, expansion) => + writeByte(INLINED) + bindings.foreach(preRegister) + withLength { pickleTree(call); pickleTree(expansion); bindings.foreach(pickleTree) } case TypeTree() => pickleTpt(tree) case Bind(name, body) => |