diff options
author | Martin Odersky <odersky@gmail.com> | 2016-03-11 10:48:33 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-03-12 14:25:01 +0100 |
commit | d34a9e3d89a8e205e23a6d59e02ccf736dd572f4 (patch) | |
tree | a01b2f756487793dcae7cd66b758d03b181e1204 /src | |
parent | e5cad0c2ccfd4e8ea3dfb9f0eb22ab0a958287f8 (diff) | |
download | dotty-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')
-rw-r--r-- | src/dotty/tools/dotc/ast/TreeTypeMap.scala | 4 |
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) |