I have two traits A and B where A's self type is B.
trait A {
self: B =>
}
trait B
How would I now construct a factory method for implementations of Trait A with Trait B and its sub-types are taken as a type parameter like this?
def factory[T <: B](args): A with B