diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-01 11:59:13 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:07:00 +0200 |
commit | c87a9dd1f34cd7afe3fba0edfa1463019eaa78bd (patch) | |
tree | 7500f567d08b96ccbf3a26dd02b76c0ca42aadda /src/dotty/tools/dotc/typer/Namer.scala | |
parent | 56f01cdf9081b0b221a01e5ae1a9f10e4aa62da9 (diff) | |
download | dotty-c87a9dd1f34cd7afe3fba0edfa1463019eaa78bd.tar.gz dotty-c87a9dd1f34cd7afe3fba0edfa1463019eaa78bd.tar.bz2 dotty-c87a9dd1f34cd7afe3fba0edfa1463019eaa78bd.zip |
First version of inline scheme
To be done: outer accessors
To be done: error positions
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 7 |
1 files changed, 7 insertions, 0 deletions
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. */ |