Let's say I have the following classes:
class A[T] { ... }
abstract class B[T1,T2](t: T1)(implicit ev: A[T2]) {
...
}
In some cases, when I inherit from B, the type for T2 is the same as for T1. Is there a way I can define my class so as not to explicitly state this?
Therefore, instead of doing:
class C extends B[String, String]("Some string") {
...
}
Can I have a compiler how to draw a conclusion, so I only need to write:
class C extends B("Some string") {
...
}
source
share