-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #8314: Define TupleXXL equals and hashCode as in case classes #8316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f941f8b
to
5c08a96
Compare
|
||
override def toString: String = elems.asInstanceOf[Array[Object]].mkString("(", ",", ")") | ||
|
||
override def hashCode: Int = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For case classes we normally delegate to scala.runtime.ScalaRunTime._hashCode
, couldn't we do this here too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can.
Though we do not seem to be delegating ti this method for case classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though we do not seem to be delegating ti this method for case classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean that I saw some code generated in the hashCode, which I used as a template for the first implementation. Maybe we are optimizing by mistake something that we should not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a primitive type field in the case class we do write it by hand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then that was the case
No description provided.