From 96d057364703a9b89ca49f2ac16f2cdb140d396d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 2 Sep 2016 17:23:54 +0200 Subject: Support separate compilation Inline trees can now be read form TASTY. However, positions are not set correctly. This remains to be implemented. --- src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala') 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 } -- cgit v1.2.3