0
爲什麼在編譯此代碼段時出現錯誤?推斷的類型參數
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]]
我該如何解決這個問題?
LongField定義:
class LongField[OwnerType <: Record[OwnerType]](rec: OwnerType)
extends Field[Long, OwnerType] with MandatoryTypedField[Long] with LongTypedField {