Skip to content

Commit 7bf8ffa

Browse files
committed
Drop annotations from trait static super accessor
Based on review suggestion by retronym. See also scala/scala-dev#213
1 parent 7a57c6e commit 7bf8ffa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ abstract class BCodeSkelBuilder extends BCodeHelpers {
494494
genDefDef(statified)
495495
} else {
496496
val forwarderDefDef = {
497-
val dd1 = global.gen.mkStatic(deriveDefDef(dd)(_ => EmptyTree), traitSuperAccessorName(sym), _.cloneSymbol)
497+
val dd1 = global.gen.mkStatic(deriveDefDef(dd)(_ => EmptyTree), traitSuperAccessorName(sym), _.cloneSymbol.withoutAnnotations)
498498
dd1.symbol.setFlag(Flags.ARTIFACT).resetFlag(Flags.OVERRIDE)
499499
val selfParam :: realParams = dd1.vparamss.head.map(_.symbol)
500500
deriveDefDef(dd1)(_ =>

test/files/run/junitForwarders/C_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ object Test extends App {
1010
assert(s == e, s"found: $s\nexpected: $e")
1111
}
1212
check(classOf[C], "foo - @org.junit.Test()")
13-
// TODO scala-dev#213: should `foo$` really carry the @Test annotation?
14-
check(classOf[T], "$init$ - ;foo - @org.junit.Test();foo$ - @org.junit.Test()")
13+
// scala/scala-dev#213, scala/scala#5570: `foo$` should not have the @Test annotation
14+
check(classOf[T], "$init$ - ;foo - @org.junit.Test();foo$ - ")
1515
}

0 commit comments

Comments
 (0)