scala/bug

simpler named arguments translation for pure arguments

Closed this issue · 4 comments

To avoid:

Added @deprecated(since = "now", message = "Bla bla bla") to a class, and got this:

Usage of named or default arguments transformed this annotation constructor call into a block. The corresponding AnnotationInfo will contain references to local values and default getters instead of the actual argument trees

We should detect when the arguments are pure (literals, idents that won't trigger any computation (including lazy val init or module init), and just reorder the arguments without a block.

Imported From: https://issues.scala-lang.org/browse/SI-7656?orig=1
Reporter: @retronym
Affected Versions: 2.10.0
See #8868