次のような名前衝突の状況で型パラメーター/メンバーのいずれかを変更する必要がないように、エイリアシングを使用できますか?
trait Bar {
type A
}
trait Foo {
def get[A]: Option[Bar { type A = A }] // "illegal cyclic reference"
}
私は書くことができることを知っています
trait Foo {
def get[A1]: Option[Bar { type A = A1 }]
}
しかし、私は型名を変更しないことを本当に望んでいます。