我试图编译包含
class FixedIndexedRepository(override val name: java.lang.String, location: URI) extends FixedIndexedRepo
which extends FixedIndexedRepo
which extends Java 类AbstractIndexedRepo
public abstract class AbstractIndexedRepo implements RegistryPlugin, Plugin, RemoteRepositoryPlugin, IndexProvider, Repository {
...
protected String name = this.getClass().getName();
...
不幸的是,Scala 2.9.2 编译器因错误而停止:
.../FixedIndexedRepository.scala:29: overriding variable name in class AbstractIndexedRepo of type java.lang.String;
[error] value name has incompatible type
[error] class FixedIndexedRepository(override val name: java.lang.String, location: URI) extends FixedIndexedRepo
如何解决这个问题?怎么了?