I am having trouble understanding how to use manifests.
What is my problem: I created a new parameterized class C and tried to override such values:
override def equals(that:Any)=that match{
case that:C[T] => true
case _ => false
}
Of course, I get a "warning: the invariant type argument T in a template of type C [T] is not checked, because it is eliminated by erasing." I tried using manifests, as I used in many other functions:
override def equals(that:Any)(implicit manifest:Manifest[T])=that match{
case that:C[T] => true
case _ => false
}
But I realized that the error message: the method does not overlap anything either.
I do not know how to fix this. Can anyone help me out?
Bruna source
share