无法在Scala类中引用Java注释

无法在Scala类中引用Java注释,java,scala,annotations,Java,Scala,Annotations,我有一个scala类,它给出了编译器错误 error: expected start of definition Hello.scala:23: error: expected start of definition class Hello extends Baz { 我认为原因在于我引用了一个预编译java库中的注释。scala代码的简化版本如下所示: import com.xx.{ Bar, Baz } @Bar(value = "XX", description = "xx")

我有一个scala类,它给出了编译器错误

error: expected start of definition
Hello.scala:23: error: expected start of definition
class Hello extends Baz {
我认为原因在于我引用了一个预编译java库中的注释。scala代码的简化版本如下所示:

import com.xx.{
  Bar,
  Baz
}

@Bar(value = "XX", description = "xx")

class Foo extends Baz {
}
java代码是:

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
public @interface Bar {

  String value() default "";
  String description() default "";
}

我使用的是Scala 2.10.3。谢谢你的帮助

注释和类定义之间不能有空行,这一行应该有效:

import com.xx.{Bar,Baz}

@Bar(value = "XX", description = "xx")
class Foo extends Baz {
}

尽量提供至少可以编译的代码。是Hello还是Foo导致了问题?Baz的定义是什么?