@@ -30,6 +30,7 @@ import config.Feature.sourceVersion
3030import config .SourceVersion .*
3131
3232import scala .compiletime .uninitialized
33+ import dotty .tools .dotc .util .ParsedComment .docOf
3334
3435/** This class creates symbols from definitions and imports and gives them
3536 * lazy types.
@@ -1255,6 +1256,8 @@ class Namer { typer: Typer =>
12551256 newSymbol(cls, forwarderName, mbrFlags, mbrInfo, coord = span)
12561257
12571258 forwarder.info = avoidPrivateLeaks(forwarder)
1259+
1260+ // Add annotations at the member level
12581261 forwarder.addAnnotations(sym.annotations.filterConserve { annot =>
12591262 annot.symbol != defn.BodyAnnot
12601263 && annot.symbol != defn.TailrecAnnot
@@ -1290,6 +1293,15 @@ class Namer { typer: Typer =>
12901293 foreachDefaultGetterOf(sym.asTerm,
12911294 getter => addForwarder(
12921295 getter.name.asTermName, getter.asSeenFrom(path.tpe), span))
1296+
1297+ // adding annotations at the parameter level
1298+ // TODO: This probably needs to be filtred to avoid adding some annotation
1299+ // such as MacroAnnotations
1300+ if sym.is(Method ) then
1301+ for (orig, forwarded) <- sym.paramSymss.lazyZip(forwarder.paramSymss)
1302+ (origParameter, exportedParameter) <- orig.lazyZip(forwarded)
1303+ do
1304+ exportedParameter.addAnnotations(origParameter.annotations)
12931305 end addForwarder
12941306
12951307 def addForwardersNamed (name : TermName , alias : TermName , span : Span ): Unit =
0 commit comments