diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-15 10:57:33 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-03-18 16:06:33 +0100 |
commit | 9c7cf4ee6196e0ec9ac7c7701de417bd9cb31c43 (patch) | |
tree | 3b5a3cc8c6046e29e2b0a0c64db60922b692efc9 /src/dotty/tools/dotc/core | |
parent | 164ecb70593728ce218e04f4e316a32ae346e4b7 (diff) | |
download | dotty-9c7cf4ee6196e0ec9ac7c7701de417bd9cb31c43.tar.gz dotty-9c7cf4ee6196e0ec9ac7c7701de417bd9cb31c43.tar.bz2 dotty-9c7cf4ee6196e0ec9ac7c7701de417bd9cb31c43.zip |
Renamings TreeTransformer -> TreeMap, TreeMapper -> TreeTypeMap
This makes naming uniform between trees and types, and also avoids the clash with
transform.TreeTransformer. The idea is that transformers are parts of phases, and
have logic that is phase-specific. In particular, a context is passed around when
transforming a tree. Maps are simpler, they only have a T -> T apply method.
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index aa0cbb5a9..3fc8a4f2c 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -19,7 +19,7 @@ import Annotations._ import util.Positions._ import StdNames._ import NameOps._ -import ast.tpd.{TreeMapper, Tree} +import ast.tpd.{TreeTypeMap, Tree} import Denotations.{ Denotation, SingleDenotation, MultiDenotation } import collection.mutable import io.AbstractFile @@ -278,7 +278,7 @@ trait Symbols { this: Context => else { val copies: List[Symbol] = for (original <- originals) yield newNakedSymbol[original.ThisName](original.coord) - val treeMap = new TreeMapper(typeMap, ownerMap) + val treeMap = new TreeTypeMap(typeMap, ownerMap) .withSubstitution(originals, copies) (originals, copies).zipped foreach {(original, copy) => val odenot = original.denot diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 9714f7eae..6dda937d2 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2169,7 +2169,7 @@ object Types { annot.derivedAnnotation(mapOver(annot.tree)) def mapOver(tree: Tree): Tree = - new TreeMapper(this).apply(tree) + new TreeTypeMap(this).apply(tree) /** Can be overridden. By default, only the prefix is mapped. */ protected def mapClassInfo(tp: ClassInfo): ClassInfo = |