@@ -7,6 +7,7 @@ import Types._, Contexts._, Constants._, Names._, Flags._
7
7
import SymDenotations ._ , Symbols ._ , Annotations ._ , Trees ._ , Symbols ._
8
8
import Denotations ._ , Decorators ._
9
9
import dotty .tools .dotc .transform .SymUtils ._
10
+ import core .tasty .TreePickler .Hole
10
11
11
12
/** A map that applies three functions and a substitution together to a tree and
12
13
* makes sure they are coordinated so that the result is well-typed. The functions are
@@ -115,6 +116,8 @@ class TreeTypeMap(
115
116
val guard1 = tmap.transform(guard)
116
117
val rhs1 = tmap.transform(rhs)
117
118
cpy.CaseDef (cdef)(pat1, guard1, rhs1)
119
+ case Hole (n, args) =>
120
+ Hole (n, args.mapConserve(transform)).withPos(tree.pos).withType(mapType(tree.tpe))
118
121
case tree1 =>
119
122
super .transform(tree1)
120
123
}
@@ -154,7 +157,7 @@ class TreeTypeMap(
154
157
assert(! to.exists(substFrom contains _))
155
158
assert(! from.exists(newOwners contains _))
156
159
assert(! to.exists(oldOwners contains _))
157
- newMap (
160
+ new TreeTypeMap (
158
161
typeMap,
159
162
treeMap,
160
163
from ++ oldOwners,
@@ -163,16 +166,6 @@ class TreeTypeMap(
163
166
to ++ substTo)
164
167
}
165
168
166
- /** A new map of the same class this one */
167
- protected def newMap (
168
- typeMap : Type => Type ,
169
- treeMap : Tree => Tree ,
170
- oldOwners : List [Symbol ],
171
- newOwners : List [Symbol ],
172
- substFrom : List [Symbol ],
173
- substTo : List [Symbol ])(implicit ctx : Context ) =
174
- new TreeTypeMap (typeMap, treeMap, oldOwners, newOwners, substFrom, substTo)
175
-
176
169
/** Apply `typeMap` and `ownerMap` to given symbols `syms`
177
170
* and return a treemap that contains the substitution
178
171
* between original and mapped symbols.
0 commit comments