You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@lrytz said:
You need to add the final modifier to the value definitions in the scala objects.
From the specification:
A constant value definition is of the form
[[BR]] final val x = e
[[BR]]
where e is a constant expression (�6.24). The final modifier must be present and no type annotation may be given.
I've got an annotation in a Java file:
And some Scala code that uses the annotations:
After compiling the Java file, I compile the Scala file and
get the following error messages:
Test.scala:13: error: annotation argument needs to be a constant; found: Action.RENDER
@anno(action = Action.RENDER, roles = Array ( Roles.ADMIN ) )
^
Test.scala:13: error: annotation argument needs to be a constant; found: Roles.ADMIN
@anno(action = Action.RENDER, roles = Array ( Roles.ADMIN ) )
^
two errors found
Note that the first use of the annotation is Ok, but the
second use where the values are from a val, are flagged as
being not constant.
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: