我有两个特点:
trait ThingA[B, A <: OtherThingA[B]] extends ExtendedThing[B, A] {
def ImportantButNotSharedLogicThing =
"Something different"
}
trait ThingB[B, A <: OtherThingA[B]] extends ExtendedThing[B, A] {
def ImportantButNotSharedLogicThing =
"Something different again"
}
和ExtendedThing
trait ExtendedThing[B, A <: OtherThing[B]] {
<lots of shared logic>
<even more shared logic>
def apply(): A =
ImportantButNotSharedLogicThing()
}
如果我有一个扩展ThingA
的对象
object Someobject extends ThingA
,apply
SmartsOrderWriter()
方法
从ExtendedThing
特征,我如何调用ThingA
或ThingB
中定义的方法(对于扩展ThingB
的对象