Closed
Description
In the code bellow, a default argument causes automatic generation of a companion object. This object seems to inherit the @alpha
annotation from the class. Then, the annotations on the class and the object clash.
minimized code
@scala.annotation.alpha("A") class B(i: Int = 1)
output
1 |@scala.annotation.alpha("A") class B(i: Int = 1)
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|@alpha annotation "A" clashes with other definition is same scope
expectation
The companion object should be generated in such a way, that its definition does not clash with the class.