@@ -7,6 +7,7 @@ import Types._, Contexts._, Constants._, Names._, Flags._
77import SymDenotations ._ , Symbols ._ , Annotations ._ , Trees ._ , Symbols ._
88import Denotations ._ , Decorators ._
99import dotty .tools .dotc .transform .SymUtils ._
10+ import core .tasty .TreePickler .Hole
1011
1112/** A map that applies three functions and a substitution together to a tree and
1213 * makes sure they are coordinated so that the result is well-typed. The functions are
@@ -115,6 +116,8 @@ class TreeTypeMap(
115116 val guard1 = tmap.transform(guard)
116117 val rhs1 = tmap.transform(rhs)
117118 cpy.CaseDef (cdef)(pat1, guard1, rhs1)
119+ case Hole (n, args) =>
120+ Hole (n, args.mapConserve(transform)).withPos(tree.pos).withType(mapType(tree.tpe))
118121 case tree1 =>
119122 super .transform(tree1)
120123 }
@@ -154,7 +157,7 @@ class TreeTypeMap(
154157 assert(! to.exists(substFrom contains _))
155158 assert(! from.exists(newOwners contains _))
156159 assert(! to.exists(oldOwners contains _))
157- newMap (
160+ new TreeTypeMap (
158161 typeMap,
159162 treeMap,
160163 from ++ oldOwners,
@@ -163,16 +166,6 @@ class TreeTypeMap(
163166 to ++ substTo)
164167 }
165168
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-
176169 /** Apply `typeMap` and `ownerMap` to given symbols `syms`
177170 * and return a treemap that contains the substitution
178171 * between original and mapped symbols.
0 commit comments