Hmm, that’s interesting. Actually ScalaRunTime._equals
hasn’t been used by case classes for a very long time:
It was used in Scala until v2.6, when it got disabled (16d3cf1) and then completely removed in v2.8 (76294e0). I don’t think that method is used anywhere now,
For reference, the code that generates the current implementation of equals
is at SyntheticMethods.scala:203. The method’s scaladoc describes fairly well what you’ll get.
As to the reason for the change, those commit don’t mention anything…
The old implementation used productArity
and productElement
at runtime to enumerate the content of the case class. Maybe this was to remove the direct dependency on Product
(case classes that don’t extend Product
? who knows…), or to support people overriding those methods (although that’s madness)…
—
Antoine
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hmm, that’s interesting. Actually
ScalaRunTime._equals
hasn’t been used by case classes for a very long time:It was used in Scala until v2.6, when it got disabled (16d3cf1) and then completely removed in v2.8 (76294e0). I don’t think that method is used anywhere now,
For reference, the code that generates the current implementation of
equals
is at SyntheticMethods.scala:203. The method’s scaladoc describes fairly well what you’ll get.As to the reason for the change, those commit don’t mention anything…
The old implementation used
productArity
andproductElement
at runtime to enumerate the content of the case class. Maybe this was to remove the direct dependency onProduct
(case classes that don’t extendProduct
? who knows…), or to support people overriding those methods (although that’s madness)…