Suppose there are two traits
trait LongKeyedRestricted[OwnerType <: LongKeyedRestricted[OwnerType]] {
self: => OwnerType
}
trait LongKeyed[OwnerType] {
self: => OwnerType
}
First trait definition is explicit that type parameter must be a subtype of LongKeyedRestricted[OwnerType]. However, given following definition of some User class
class User extends LongKeyed[User]
Am I not saying that User is a subtype of LongKeyed[User]. My question is how extra restriction in first trait definition is useful, I could not find a use case where this can be violated.
Note
Reference Liftweb
trait LongKeyedMapper[OwnerType <: LongKeyedMapper[OwnerType]] extends KeyedMapper[Long, OwnerType] with BaseLongKeyedMapper {
self: OwnerType =>
}