aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/TreeTypeMap.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-03-11 10:48:33 +0100
committerMartin Odersky <odersky@gmail.com>2016-03-12 14:25:01 +0100
commitd34a9e3d89a8e205e23a6d59e02ccf736dd572f4 (patch)
treea01b2f756487793dcae7cd66b758d03b181e1204 /src/dotty/tools/dotc/ast/TreeTypeMap.scala
parente5cad0c2ccfd4e8ea3dfb9f0eb22ab0a958287f8 (diff)
downloaddotty-d34a9e3d89a8e205e23a6d59e02ccf736dd572f4.tar.gz
dotty-d34a9e3d89a8e205e23a6d59e02ccf736dd572f4.tar.bz2
dotty-d34a9e3d89a8e205e23a6d59e02ccf736dd572f4.zip
Refinement to TreeTypeMap
When recursing in a template body, need to update the context's owner, so that `ref` can work correctly.
Diffstat (limited to 'src/dotty/tools/dotc/ast/TreeTypeMap.scala')
-rw-r--r--src/dotty/tools/dotc/ast/TreeTypeMap.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
index d714a3d21..856a471dd 100644
--- a/src/dotty/tools/dotc/ast/TreeTypeMap.scala
+++ b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
@@ -82,9 +82,11 @@ final class TreeTypeMap(
constr = tmap.transformSub(constr),
parents = parents mapconserve transform,
self = tmap.transformSub(self),
- body = impl.body mapconserve tmap.transform
+ body = impl.body mapconserve
+ (tmap.transform(_)(ctx.withOwner(mapOwner(impl.symbol.owner))))
).withType(tmap.mapType(impl.tpe))
case tree1 =>
+ println(i"tree type map $tree1, owner = ${ctx.owner}")
tree1.withType(mapType(tree1.tpe)) match {
case id: Ident if tpd.needsSelect(id.tpe) =>
ref(id.tpe.asInstanceOf[TermRef]).withPos(id.pos)