Help to understand which method is called

If none of your superclasses override equals it should be the same as this eq that.asInstanceOf[AnyRef].

See https://github.com/scala/scala/pull/7348 for the new mutable HashMap and https://github.com/scala/scala/pull/6975 for cached hashcodes in the new immutable HashMap.

1 Like

That effectively changes nothing, except that your stacktraces that cross that method implementation will be longer.

Well one thing it does do is prevents scala from writing another equals method for the case class.

Is this statement still true in light of the other discussion? in Dynamic dispatch on object, but static …

Yes, that’s right. I’ve forgot about things automatically generated by Scala compiler.

I was somewhat imprecise when writing that statement. It’s true if you don’t combine overloading with upcasting (unless I forgot something) and can be false otherwise. That other discussion clears thing up.

1 Like