loại đệ quy trực tiếp chỉ hoạt động:đệ quy định nghĩa kiểu generic gián tiếp trong scala
trait TT[T<:TT[T]]
Nhưng tôi có thể thực hiện một gián tiếp với cách tiếp cận ngây thơ
trait UU[V <: VV[UU[V]]]
trait VV[U <: UU[VV[U]]]
cho tôi lỗi:
CyclicTraits.scala:23: error: type arguments [UU[V]] do not conform to
trait VV's type parameter bounds [U <: UU[VV[U]]]
trait UU[V <: VV[UU[V]]]
^
CyclicTraits.scala:25: error: type arguments [VV[U]] do not conform to
trait UU's type parameter bounds [V <: VV[UU[V]]]
trait VV[U <: UU[VV[U]]]
^
Việc đệ quy tham số kiểu gián tiếp nên được thể hiện đúng cách như thế nào?