File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import dotty.tools.dotc.ast.tpd
1919import typer .Implicits .SearchFailureType
2020
2121import scala .collection .mutable
22- import dotty .tools .dotc .core .Annotations .Annotation
22+ import dotty .tools .dotc .core .Annotations ._
2323import dotty .tools .dotc .core .Names ._
2424import dotty .tools .dotc .core .StdNames ._
2525import dotty .tools .dotc .core .quoted ._
@@ -405,6 +405,15 @@ class ReifyQuotes extends MacroTransform {
405405 // TODO move to FirstTransform to trigger even without quotes
406406 cpy.DefDef (tree)(rhs = defaultValue(tree.rhs.tpe))
407407
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)
408417 case _ =>
409418 super .transform(tree)
410419 }
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ t3612.scala
66
77# Other failure
88t802.scala
9+ i7052.scala
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