Closed
Description
Java annotation "parameters" are declared as fields
public @interface Ann {
int a() default 41;
int b() default 42;
int c() default 43;
}
Scala 3 allows @Ann(1)
. Reordering the fields in Ann
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)
.