3
我可以使用别名,所以我不需要改变任何类型的参数/成员的以下名称冲突的情况:型走样,以避免在类型精名称冲突
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 }]
}
但我真的不希望改变类型名称。