aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-09 21:41:56 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:11:21 +0200
commit184296f694d3623098864b8313b2ed7ccf7380f1 (patch)
tree96ea0066fd86ffa4505b84c8b667c4c7e599cd14 /src/dotty/tools/dotc/typer/Typer.scala
parentb1cda4fadcb586a82b546751d5cc426cd5382cd5 (diff)
downloaddotty-184296f694d3623098864b8313b2ed7ccf7380f1.tar.gz
dotty-184296f694d3623098864b8313b2ed7ccf7380f1.tar.bz2
dotty-184296f694d3623098864b8313b2ed7ccf7380f1.zip
Inline argument closures to inline methods
If an argumnet to an inline method refers to a closure that is the result of eta-expanding another inline method inline the argument method.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 8830537e3..c8362522d 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -744,7 +744,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case WildcardType(_) => untpd.TypeTree()
case _ => untpd.TypeTree(protoResult)
}
- desugar.makeClosure(inferredParams, fnBody, resultTpt)
+ val inlineable = fnBody match {
+ case Apply(untpd.TypedSplice(fn), _) => Inliner.hasBodyToInline(fn.symbol)
+ case _ => false
+ }
+ desugar.makeClosure(inferredParams, fnBody, resultTpt, inlineable)
}
typed(desugared, pt)
}