$ cat Z.scala
object Test {
class myAnnotation extends scala.annotation.StaticAnnotation
def dontForgetTheAnnotation_ = {
@myAnnotation val y = 3
}
}
$ scalac Z.scala -Xprint:spec
[[syntax trees at end of specialize]] // Z.scala
package <empty> {
object Test extends Object {
...
def dontForgetTheAnnotation_: Unit = {
@Test.myAnnotation val y: Int = 3;
()
};
<specialized> def dontForgetTheAnnotation_!$mIc$sp(x: Int): Unit = {
val y: Int = 3; // @Test.annotation was lost during duplication
()
}
}
}
This prevents a full fix for #7344.
This prevents a full fix for #7344.