@@ -9,6 +9,7 @@ import printing.{Showable, Printer}
99import printing .Texts .Text
1010
1111import scala .annotation .internal .sharable
12+ import dotty .tools .dotc .ast .TreeTypeMap
1213
1314object Annotations {
1415
@@ -30,7 +31,7 @@ object Annotations {
3031 def derivedAnnotation (tree : Tree )(using Context ): Annotation =
3132 if (tree eq this .tree) this else Annotation (tree)
3233
33- /** All arguments to this annotation in a single flat list */
34+ /** All type and term arguments to this annotation in a single flat list */
3435 def arguments (using Context ): List [Tree ] = tpd.allArguments(tree)
3536
3637 def argument (i : Int )(using Context ): Option [Tree ] = {
@@ -62,10 +63,20 @@ object Annotations {
6263 if tm.isRange(x) then x
6364 else
6465 val tp1 = tm(tree.tpe)
65- foldOver(if tp1 frozen_ =: = tree.tpe then x else tp1, tree)
66+ foldOver(if tp1 = = tree.tpe then x else tp1, tree)
6667 val diff = findDiff(NoType , args)
6768 if tm.isRange(diff) then EmptyAnnotation
68- else if diff.exists then derivedAnnotation(tm.mapOver(tree))
69+ else if diff.exists then
70+ val ttm = new TreeTypeMap (typeMap = tm):
71+ /*
72+ final override def transformDefs[TT <: Tree](trees: List[TT])(using Context): (TreeTypeMap, List[TT]) =
73+ val syms = localSyms(trees)
74+ val ttmap = withMappedSyms(syms, mapSymbols(syms, this, mapAlways = true))
75+ (ttmap, ttmap.transformSub(trees))
76+ */
77+ final override def withMappedSyms (syms : List [Symbol ]): TreeTypeMap =
78+ withMappedSyms(syms, mapSymbols(syms, this , mapAlways = true ))
79+ derivedAnnotation(ttm.transform(tree))
6980 else this
7081
7182 /** Does this annotation refer to a parameter of `tl`? */
0 commit comments