下面的类在这一行引发编译器错误val userList : List[User]
:
Multiple markers at this line
- only classes can have declared but undefined members
- only classes can have declared but undefined members
这是整个代码:
class SimilarityData {
case class User(id: String, jCoeff : Int)
def getUsers() =
{
val userList : List[User]
userList :+ new User("1" , 1);
}
}
是什么导致了这个错误?