为什么在编译此代码段时出现错误?
trait ID[R <: Record[R] with KeyedRecord[Long]] {
this: R =>
val idField = new LongField(this)
}
错误:
inferred type arguments [ID[R] with R] do not conform to class LongField's
type parameter bounds [OwnerType <: net.liftweb.record.Record[OwnerType]]
我怎样才能解决这个问题?
长字段定义:
class LongField[OwnerType <: Record[OwnerType]](rec: OwnerType)
extends Field[Long, OwnerType] with MandatoryTypedField[Long] with LongTypedField {