I desire to have automatic type inference on a class with a sequence s of objects which are descendant of A, knowing that A takes generic parameters.
class A[F](val field1: F)
class G[F, Aa <: A[F], S <: Seq[Aa]](val s: S) {
// what i have to do
}
// Evrything is ok
val gWith = new G[Int, A[Int], List[A[Int]]](List(new A(5)))
// Compilator failed: inferred type arguments [Nothing,Nothing,List[A[Int]]]
val gWithout = new G(List(new A(5)))
I will add that i explicitly need to know Aa and S types to reuse them later.
Is there any solution to dispense user to put these generic types. If not i will be happy to know why.