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
The language specification has
"Method hashCode: ()int computes a hash-code depending on the data
structure in a way which maps equal (with respect to equals) values to equal
hash-codes."
This is only true if the hashCodes of constructor arguments have this property (see example below).
Some possible alternative wordings:-
"Method hashCode: ()int computes a hash-code depending on the data
structure in a way which maps equal (with respect to equals) values to equal
hash-codes, provided the hashCode methods of the data structure members each map equal
(with respect to equals) values to equal hash-codes."
"Method hashCode: ()int computes a hash-code. If the hashCode methods of the data structure members map
equal (with respect to equals) values to equal hash-codes, then the case class hashCode method does too."
Aladdin: [http://scala-webapps.epfl.ch/bugtracking/bugs/displayItem.do?id=1293 bug 1293], [http://scala-webapps.epfl.ch/bugtracking/contribs/display.do?id=775 contrib 775]
== Code ==
The language specification has
"Method
hashCode: ()int
computes a hash-code depending on the datastructure in a way which maps equal (with respect to equals) values to equal
hash-codes."
This is only true if the hashCodes of constructor arguments have this property (see example below).
Some possible alternative wordings:-
"Method hashCode: ()int computes a hash-code depending on the data
structure in a way which maps equal (with respect to equals) values to equal
hash-codes, provided the hashCode methods of the data structure members each map equal
(with respect to equals) values to equal hash-codes."
"Method hashCode: ()int computes a hash-code. If the hashCode methods of the data structure members map
equal (with respect to equals) values to equal hash-codes, then the case class hashCode method does too."
== What happened ==
== What expected ==
The text was updated successfully, but these errors were encountered: