You're inheriting nothing, so the super.equals
you're getting, possibly that of Product2
(assuming it has a meaningful one of its own) or scala.ScalaObject, is probably not what you want.
But the real question is why are you altering the semantics of the compiler-supplied equals
?
Lastly, if there's any doubt in your mind (as evidenced by asking a question on Stack Overflow) when it comes to writing your own equals
, it behooves you to read chapter 28, "Equality," of Programming in Scala. Hint: Writing truly correct equals
is not trivial. That chapter is 26 pages long! (Note: I have only the 1st ed. at hand.)
Frankly, as infrequently as I need to write my own equals, I end up consulting that chapter every time I do.