获得错误的“丢失说明”的注释。通过将注释数组传递到另一个注释
通过将注释的数组传递到Java中的另一个注释中,从而获得错误的“丢失注释语句”。代码看起来像这样:
public @interface Big {
String abc() default "";
}
public @interface B {
String name() default "";
Big[] big() default {};
}
Scala中的以下类,
@B(name = "Reema",big = {@Big(abc = "a"), @Big(abc = "b")})
class MainTest() {
...
}
我尝试了上述代码,它给了我错误:Scala类中的“丢失语句”。 我想解决编译器问题。
Getting error "Missing statement for annotation" by passing the array of annotation into another annotation in java. Code looks like this :
public @interface Big {
String abc() default "";
}
public @interface B {
String name() default "";
Big[] big() default {};
}
The following class in scala
@B(name = "Reema",big = {@Big(abc = "a"), @Big(abc = "b")})
class MainTest() {
...
}
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了使嵌套注释在Scala中起作用,您必须这样使用它们:
In order to make nested annotations work in Scala you have to use them like this: