aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/ast')
-rw-r--r--src/dotty/tools/dotc/ast/TreeTypeMap.scala9
-rw-r--r--src/dotty/tools/dotc/ast/untpd.scala4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
index 0593e8159..6d0c7d8e3 100644
--- a/src/dotty/tools/dotc/ast/TreeTypeMap.scala
+++ b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
@@ -6,6 +6,8 @@ import core._
import Types._, Contexts._, Constants._, Names._, Flags._
import SymDenotations._, Symbols._, Annotations._, Trees._, Symbols._
import Denotations._, Decorators._
+import typer.Inliner
+import config.Printers.inlining
import dotty.tools.dotc.transform.SymUtils._
/** A map that applies three functions and a substitution together to a tree and
@@ -92,7 +94,12 @@ final class TreeTypeMap(
case ddef @ DefDef(name, tparams, vparamss, tpt, _) =>
val (tmap1, tparams1) = transformDefs(ddef.tparams)
val (tmap2, vparamss1) = tmap1.transformVParamss(vparamss)
- cpy.DefDef(ddef)(name, tparams1, vparamss1, tmap2.transform(tpt), tmap2.transform(ddef.rhs))
+ val res = cpy.DefDef(ddef)(name, tparams1, vparamss1, tmap2.transform(tpt), tmap2.transform(ddef.rhs))
+ if (Inliner.hasBodyToInline(res.symbol)) {
+ inlining.println(i"update inline body ${res.symbol}")
+ Inliner.updateInlineBody(res.symbol, res.rhs)
+ }
+ res
case blk @ Block(stats, expr) =>
val (tmap1, stats1) = transformDefs(stats)
val expr1 = tmap1.transform(expr)
diff --git a/src/dotty/tools/dotc/ast/untpd.scala b/src/dotty/tools/dotc/ast/untpd.scala
index a0a353c13..cc7cefbac 100644
--- a/src/dotty/tools/dotc/ast/untpd.scala
+++ b/src/dotty/tools/dotc/ast/untpd.scala
@@ -20,7 +20,9 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
override def isType = op.isTypeName
}
- /** A typed subtree of an untyped tree needs to be wrapped in a TypedSlice */
+ /** A typed subtree of an untyped tree needs to be wrapped in a TypedSlice
+ * @param owner The current owner at the time the tree was defined
+ */
abstract case class TypedSplice(tree: tpd.Tree)(val owner: Symbol) extends ProxyTree {
def forwardTo = tree
}