-
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
SeqMap.keys != VectorMap.keys (with identical keys) for sizes 0 to 4 #12991
Comments
Unfortunately, this is permissible behavior by design because However, this can still be fixed anyway. It turns out that |
@scala/collections |
The Scaladoc was clarified in https://github.com/scala/scala/pull/10544/files The language of the doc is designed to dissuade from assumptions about Edit: it looks like |
If Regardless, this is permissible behavior. What is the right way to say "do these two SeqMaps have the same keys in the same order?" |
@jackkoenig I see SeqMap doc says order is not relevant for equals. For keys,
I submitted a PR to tweak |
Reproduction steps
Shows up in Scala 2.13.13 and Scala 3.3.3 (which makes sense as this is the behavior of the standard library)
This prints:
(Also in Scastie form: https://scastie.scala-lang.org/5eMlHcERQsSNQ4mXent1XQ)
Problem
I would expect the
.keys
to be equal forSeqMap
andVectorMap
. Note that we do get the expected behavior for sizes > 4, presumably due to specialization of SeqMap0-4.The text was updated successfully, but these errors were encountered: