aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/TreeTypeMap.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-04 18:18:57 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:11:21 +0200
commita81070ca1af106688b03c46d96f4266934d8cfbb (patch)
treeec4520668276b45cf083e73f2a043a224325ce71 /src/dotty/tools/dotc/ast/TreeTypeMap.scala
parentc1674dc461ee3f4bf38b7b895cfc9d7d6b41b53f (diff)
downloaddotty-a81070ca1af106688b03c46d96f4266934d8cfbb.tar.gz
dotty-a81070ca1af106688b03c46d96f4266934d8cfbb.tar.bz2
dotty-a81070ca1af106688b03c46d96f4266934d8cfbb.zip
Fix some problems in Inliner
1. Don't retypecheck the arguments of an inlined epressions. These might be very large (e.g. inlined track, or traceIndented in dotty)/ 2. Keep track of inlined calls in context instead of Inlined nodes. We only need the to compute the source file, the rest is irrelevant. 3. In Def bindings of inlined by-name parameters, change owner of right hand side. Otherwise we get incorrect owner chains. 4. In TreeTypeMap, treat Inlined in the same way as a block.
Diffstat (limited to 'src/dotty/tools/dotc/ast/TreeTypeMap.scala')
-rw-r--r--src/dotty/tools/dotc/ast/TreeTypeMap.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
index a35fe2e8f..0593e8159 100644
--- a/src/dotty/tools/dotc/ast/TreeTypeMap.scala
+++ b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
@@ -97,6 +97,10 @@ final class TreeTypeMap(
val (tmap1, stats1) = transformDefs(stats)
val expr1 = tmap1.transform(expr)
cpy.Block(blk)(stats1, expr1)
+ case inlined @ Inlined(call, bindings, expanded) =>
+ val (tmap1, bindings1) = transformDefs(bindings)
+ val expanded1 = tmap1.transform(expanded)
+ cpy.Inlined(inlined)(call, bindings1, expanded1)
case cdef @ CaseDef(pat, guard, rhs) =>
val tmap = withMappedSyms(patVars(pat))
val pat1 = tmap.transform(pat)