Skip to content

Commit eb34c6c

Browse files
authored
Merge pull request #9156 from dotty-staging/fix-#9155
2 parents 3dfba6d + a7decac commit eb34c6c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ class Namer { typer: Typer =>
11291129
ctx.newSymbol(cls, forwarderName, mbrFlags, mbrInfo, coord = span)
11301130
}
11311131
forwarder.info = avoidPrivateLeaks(forwarder)
1132+
forwarder.addAnnotations(sym.annotations)
11321133
val forwarderDef =
11331134
if (forwarder.isType) tpd.TypeDef(forwarder.asType)
11341135
else {

tests/run/i9155.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
object Foo:
2+
@scala.annotation.alpha("w") def \/\/ = "W"
3+
4+
object Bar:
5+
export Foo._
6+
7+
@main def Test =
8+
assert(Foo.getClass.getMethods.exists(_.getName == "w"))
9+
assert(Bar.getClass.getMethods.exists(_.getName == "w"))

0 commit comments

Comments
 (0)