Compiler should enforce named arguments for Java annotations #20554
Labels
area:annotations
compat:java
itype:bug
needs-minor-release
This PR cannot be merged until the next minor release
Milestone
Java annotation "parameters" are declared as fields
Scala 3 allows
@Ann(1)
. Reordering the fields inAnn
is a binary compatible change, but it affects the meaning of@Ann(1)
.Scala 2 does the same as Java: arguments to Java annotations always have to be specified by name. The only exception is a single positional argument, which always expands to the field named
value
, i.e.,@Ann(value = 1)
.The text was updated successfully, but these errors were encountered: