如何使用抽象类型将以下F-Bound多态转换为代码?
trait Organism[Self <: Organism[Self]] { self: Self => def reproduceWith(org:Self):Boolean } class Amoeba extends Organism[Amoeba] { def reproduceWith(org:Amoeba) = //..code }
generics types scala
generics ×1
scala ×1
types ×1