You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternatively [instead of marking productPrefix with @deprecatedOverriding as originally suggested], canEqual is broken and should include productPrefix.
…22865)
Since 2.13, case class `hashCode` mixes in the hash code of the
`productPrefix` string. This is inconsistent with the `equals` method,
subclasses of case classes that override `productPrefix` compare equal
but have a different `hashCode`
(scala/bug#13033).
This commit changes `hashCode` to mix in the `productPrefix.hashCode`
statically instead of invoking `productPrefix` at runtime.
For case classes without primitive fields, the synthetic `hashCode`
invokes `ScalaRunTime._hashCode`, which mixes in the result of
`productPrefix`. To fix that, the synthetic hashCode is changed to
invoke `MurmurHash3.productHash` directly and mix in the name to the
seed statically.
Scala 3 forward port of scala/scala#11023
Since scala/scala#7693
The text was updated successfully, but these errors were encountered: