Skip to content
Advertisement

Getting error “Missing statement for annotation” by passing the array of annotation into another annotation

Getting error “Missing statement for annotation” by passing the array of annotation into another annotation in java. Code looks like this :

JavaScript

The following class in scala

JavaScript

I tried the above code and it is giving me the error : “Missing statement for annotation” in the scala class. I want to resolve the compiler issue.

Advertisement

Answer

In order to make nested annotations work in Scala you have to use them like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement