私は次のクラスを持っています:
abstract class Base {
type T
def myMethod: T
}
abstract class B extends Base {
type T <: String
}
abstract class C extends Base {
type T <: Int
}
今、私がこれを書くと:
class Test{
self: B with C =>
// do sth with myMethod
}
myMethod は Int 型の sth になります。一方、私がこれを書く場合:
class Test{
self: C with B =>
// do sth with myMethod
}
String 型を取得します。誰かがそれを説明できますか?