aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/TreeTypeMap.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-10 06:58:38 +0200
committerMartin Odersky <odersky@gmail.com>2014-09-10 06:59:30 +0200
commit47f0b453d32488ff007f977c4361a5956d92f967 (patch)
tree6ff590f90992890522706b10023f6af554f379eb /src/dotty/tools/dotc/ast/TreeTypeMap.scala
parent81b27b159ac7e0cc7bc9b63aa9f11ea274ec4f08 (diff)
downloaddotty-47f0b453d32488ff007f977c4361a5956d92f967.tar.gz
dotty-47f0b453d32488ff007f977c4361a5956d92f967.tar.bz2
dotty-47f0b453d32488ff007f977c4361a5956d92f967.zip
Fix class decls in TypeTypeMap
If definitions in a class are substituted by TreeTypeMap, the new symbols have to show up in the `decls` scope of the class instead of the old ones.
Diffstat (limited to 'src/dotty/tools/dotc/ast/TreeTypeMap.scala')
-rw-r--r--src/dotty/tools/dotc/ast/TreeTypeMap.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
index a66932e7b..2adc6cd5d 100644
--- a/src/dotty/tools/dotc/ast/TreeTypeMap.scala
+++ b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
@@ -45,6 +45,12 @@ final class TreeTypeMap(
val parents1 = parents mapconserve transform
var self1 = transformDefs(self :: Nil)._2.head
val body1 = tmap.transformStats(body)
+ body1 foreach {
+ case mdef: MemberDef =>
+ val member = mdef.symbol
+ member.owner.asClass.enter(member, replace = true)
+ case _ =>
+ }
cpy.Template(impl)(constr1, parents1, self1, body1).withType(tmap.mapType(impl.tpe))
case tree1 =>
tree1.withType(mapType(tree1.tpe)) match {