diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-01 17:31:10 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | 8a3762a62d12b7f57de27c840425184df56b2689 (patch) | |
tree | 35db0a16b8361568290c20dcb5d215af7178cc62 /src/dotty/tools/dotc/core/tasty/TreePickler.scala | |
parent | d63a6ba8540fb8ea7d01350ea68ff1ef0b53c5d4 (diff) | |
download | dotty-8a3762a62d12b7f57de27c840425184df56b2689.tar.gz dotty-8a3762a62d12b7f57de27c840425184df56b2689.tar.bz2 dotty-8a3762a62d12b7f57de27c840425184df56b2689.zip |
Add Inlined tree node
... to tag inlined calls. Perform typings and transformations
of inlined calls in a context that refers to the INlined node
in its InlinedCall property.
The idea is that we can use this to issue better error
positions. This remains to be implemented.
Diffstat (limited to 'src/dotty/tools/dotc/core/tasty/TreePickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/tasty/TreePickler.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/src/dotty/tools/dotc/core/tasty/TreePickler.scala index e5cacfc00..fe6a5f828 100644 --- a/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -7,6 +7,7 @@ import ast.Trees._ import TastyFormat._ import Contexts._, Symbols._, Types._, Names._, Constants._, Decorators._, Annotations._, StdNames.tpnme, NameOps._ import collection.mutable +import typer.Inliner import NameOps._ import TastyBuffer._ import TypeApplications._ @@ -430,6 +431,15 @@ 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 TypeTree(original) => pickleTpt(tree) case Bind(name, body) => |