Let's look at some code first:
trait Foo[T] {
def fooize(value : T) : Unit
}
object TestFoo {
def testFooForType[T[_] <: Foo[_]](obj : T[Int]) {
obj.fooize(5)
}
}
Why doesn't it typecheck and how can I overcome this difficulty? What I want to do is to test any class that implements the given trait Foo for a particular type T (Int in the example).
Tas such in the body oftestFooForType, you might as well use simplydef testFooForType(obj: Foo[Int])...