1 Answer
1

The problem here isn't the recursion—it is actually a matter of the type parameters not conforming to the bounds, as the error message says. Your example works perfectly if you make the parameters covariant:

trait UU[+V <: VV[UU[V]]]
trait VV[+U <: UU[VV[U]]]

In your version (without the covariance), the fact that V is a subtype of VV[UU[V]] tells us nothing about whether or not UU[V] is a subtype of UU[VV[UU[V]]], so we get the conformance error. If the type parameters are covariant, we know that V being a subtype of VV[UU[V]] entails that UU[V] is a subtype of UU[VV[UU[V]]], and everything's fine.