Here's a version of the code that compiles:
object Playground2 {
trait Client[S,A] {
def wrap(v: A): (S,A)
}
class TestClient extends Client[String, Int] {
override def wrap(v: Int) = ("cache 2.00", v)
}
}
You duplicated the types again in the wrap
function and you did not need to as they were already defined on the trait itself.