-
Notifications
You must be signed in to change notification settings - Fork 21
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
Array.hashCode should acually hash the data contained #1607
Comments
Imported From: https://issues.scala-lang.org/browse/SI-1607?orig=1 |
Mohsen Lesani [X] (lesani) said: scala> Array(1,2,3).hashCode == Array(1,2,3).hashCode
res0: Boolean = false
scala> List(1,2,3).hashCode == List(1,2,3).hashCode
res1: Boolean = true The same in Trunk. |
@odersky said: |
Simon Sotak (the21st) said (edited on Mar 31, 2016 2:51:29 PM UTC): scala> mutable.Seq(1, 2).hashCode == mutable.Seq(1, 2).hashCode
res0: Boolean = true |
@SethTisue said: scala.collection.mutable.WrappedArray, on the other hand, behaves as you would like. |
Currently, Array.hashCode returns different values for different arrays, even if they contain the same data.
Example:
Array(1,2,3).hashCode == Array(1,2,3).hashCode
returns false whileList(1,2,3).hashCode == List(1,2,3).hashCode
returns true.The text was updated successfully, but these errors were encountered: