File tree 2 files changed +17
-1
lines changed
compiler/src/dotty/tools/dotc/transform 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import dotty.tools.dotc.ast.tpd
19
19
import typer .Implicits .SearchFailureType
20
20
21
21
import scala .collection .mutable
22
- import dotty .tools .dotc .core .Annotations .Annotation
22
+ import dotty .tools .dotc .core .Annotations ._
23
23
import dotty .tools .dotc .core .Names ._
24
24
import dotty .tools .dotc .core .StdNames ._
25
25
import dotty .tools .dotc .core .quoted ._
@@ -405,6 +405,15 @@ class ReifyQuotes extends MacroTransform {
405
405
// TODO move to FirstTransform to trigger even without quotes
406
406
cpy.DefDef (tree)(rhs = defaultValue(tree.rhs.tpe))
407
407
408
+ case tree : DefTree if level >= 1 =>
409
+ val newAnnotations = tree.symbol.annotations.mapconserve {
410
+ case ConcreteAnnotation (annotTree) =>
411
+ val newAnnotTree = transform(annotTree) given ctx .withOwner(tree.symbol)
412
+ ConcreteAnnotation (newAnnotTree)
413
+ case annot => annot
414
+ }
415
+ tree.symbol.annotations = newAnnotations
416
+ super .transform(tree)
408
417
case _ =>
409
418
super .transform(tree)
410
419
}
Original file line number Diff line number Diff line change
1
+ import scala .quoted ._
2
+ class Test {
3
+ def foo (str : Expr [String ]) given QuoteContext = ' {
4
+ @ deprecated($str, " " )
5
+ def bar = ???
6
+ }
7
+ }
You can’t perform that action at this time.
0 commit comments