From c9fa504161cc34ec979ae3c1b73db6798adc4872 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 15 Sep 2016 15:33:22 +0200 Subject: Inline function parameters Add inline function parameters. The previous concept of inlineable closure is adapted to coincide with an inline function parameter. --- src/dotty/tools/dotc/typer/Typer.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 18b609f8d..4c7d1c50d 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -745,10 +745,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit case WildcardType(_) => untpd.TypeTree() case _ => untpd.TypeTree(protoResult) } - val inlineable = fnBody match { - case Apply(untpd.TypedSplice(fn), _) => Inliner.hasBodyToInline(fn.symbol) - case _ => false - } + val inlineable = pt.hasAnnotation(defn.InlineParamAnnot) desugar.makeClosure(inferredParams, fnBody, resultTpt, inlineable) } typed(desugared, pt) -- cgit v1.2.3