我收到此编译消息:
推断类型参数 [sdo.core.domain.Field[_ >: 2 with java.util.UUID <: java.lang.Comparable[ >: 1 with java.util.UUID <: java.lang.Object] with java. io.Serializable]] 不符合方法 :: 的类型参数界限 [B>: sdo.core.domain.Field[ >: String with org.scala_tools.time.Imports.DateTime <: java.lang.Comparable[ _ >: java.lang.String with org.joda.time.ReadableInstant <: java.lang.Object] with java.io.Serializable]] [error] override def fieldList = this.id :: this.create :: this .name :: this.description :: 无
我想要的是一个列表Field[_]
,或者任何与Field[_]
. 我怎么做?
这是有问题的代码:
class Work( initialId :EntityUuidIdField,
initialName :NameField,
initialDescription :TextField) extends Entity{
val id = initialId
val name = initialName
val description :Field[String]= initialDescription
val create = new DateTimeField()
val begun = new DateTimeField()
val inProgress = new DateTimeField()
val done = new DateTimeField()
val subjectiveWellBeing = new SubjectiveWellBeingField()
val size = new WorkSizeField()
override def fieldList = this.id :: this.create :: this.name :: this.description :: Nil
}
以及类型的定义:
class DateTimeField extends Field[DateTime] {
class EntityUuidIdField( val id :UUID) extends EntityIdField[UUID]( id) {
class EntityIdField[T]( id :T) extends Field[T] {
class NameField extends Field[String] {
class Field[T] extends Signal[T] {