manifest - Scala: Problems with erasure on overriding equals function for parametrized classes -
i'm having troubles on understanding how use manifests.
that's problem: i've creat new parametrized class c , tryed override equals this:
override def equals(that:any)=that match{ case that:c[t] => true /*do smth else not relevant*/ case _ => false }
of course recieve "warning: non variable type-argument t in type pattern c[t] unchecked since eliminated erasure". tryied using manifests using in many other functions:
override def equals(that:any)(implicit manifest:manifest[t])=that match{ case that:c[t] => true case _ => false }
but recieved "error: method equals overrides nothing" message.
i don't know how fix this. please me?
you can't fix it. welcome joys of smooth interoperation java. way improve equals def equals(x: any): boolean
write different method.
i'm trying convince martin should implement == desugaring differently, aiming @ "def decentequals[t](x: t)(implicit equiv: equiv[t])" default implicits , bridge methods make seamless unless care, thinks equality tests shouldn't slower.
Comments
Post a Comment