From c87a9dd1f34cd7afe3fba0edfa1463019eaa78bd Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 1 Sep 2016 11:59:13 +0200 Subject: First version of inline scheme To be done: outer accessors To be done: error positions --- src/dotty/tools/dotc/typer/Namer.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 6eca9be41..06e798bdb 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -566,10 +566,17 @@ class Namer { typer: Typer => val cls = typedAheadAnnotation(annotTree) val ann = Annotation.deferred(cls, implicit ctx => typedAnnotation(annotTree)) denot.addAnnotation(ann) + if (cls == defn.InlineAnnot) addInlineInfo(ann, original) } case _ => } + private def addInlineInfo(inlineAnnot: Annotation, original: untpd.Tree) = original match { + case original: untpd.DefDef => + Inliner.attachBody(inlineAnnot, typedAheadExpr(original).asInstanceOf[tpd.DefDef].rhs) + case _ => + } + /** Intentionally left without `implicit ctx` parameter. We need * to pick up the context at the point where the completer was created. */ -- cgit v1.2.3