aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-02 17:23:54 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:11:21 +0200
commit96d057364703a9b89ca49f2ac16f2cdb140d396d (patch)
treee597ebb61fc730c3c1ba6c08fd027f7712adecb1 /src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
parenta47a8008023ea04ff7f8d708567fb6a2c516caaa (diff)
downloaddotty-96d057364703a9b89ca49f2ac16f2cdb140d396d.tar.gz
dotty-96d057364703a9b89ca49f2ac16f2cdb140d396d.tar.bz2
dotty-96d057364703a9b89ca49f2ac16f2cdb140d396d.zip
Support separate compilation
Inline trees can now be read form TASTY. However, positions are not set correctly. This remains to be implemented.
Diffstat (limited to 'src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index 56bb8498a..11f2eddac 100644
--- a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -7,6 +7,7 @@ import Contexts._, Symbols._, Types._, Scopes._, SymDenotations._, Names._, Name
import StdNames._, Denotations._, Flags._, Constants._, Annotations._
import util.Positions._
import ast.{tpd, Trees, untpd}
+import typer.Inliner
import Trees._
import Decorators._
import TastyUnpickler._, TastyBuffer._, PositionPickler._
@@ -468,6 +469,7 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) {
val isClass = ttag == TEMPLATE
val templateStart = currentAddr
skipTree() // tpt
+ val rhsStart = currentAddr
val rhsIsEmpty = noRhs(end)
if (!rhsIsEmpty) skipTree()
val (givenFlags, annots, privateWithin) = readModifiers(end)
@@ -504,6 +506,11 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) {
sym.completer.withDecls(newScope)
forkAt(templateStart).indexTemplateParams()(localContext(sym))
}
+ else (annots.find(_.symbol == defn.InlineAnnot)) match {
+ case Some(inlineAnnot) =>
+ Inliner.attachBody(inlineAnnot, forkAt(rhsStart).readTerm()(localContext(sym)))
+ case none =>
+ }
goto(start)
sym
}