Skip to content
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

TreeMap addAll should retain existing keys #12227

Closed
lrytz opened this issue Nov 16, 2020 · 0 comments · Fixed by scala/scala#9318
Closed

TreeMap addAll should retain existing keys #12227

lrytz opened this issue Nov 16, 2020 · 0 comments · Fixed by scala/scala#9318

Comments

@lrytz
Copy link
Member

lrytz commented Nov 16, 2020

After scala/scala#9291

scala> scala.collection.immutable.TreeMap[String, String]()(_ compareToIgnoreCase _) + ("a" -> "1") + ("A" -> "2")
val res0: scala.collection.immutable.TreeMap[String,String] = TreeMap(a -> 2)

scala> scala.collection.immutable.TreeMap[String, String]()(_ compareToIgnoreCase _) ++ Seq("a" -> "1", "A" -> "2")
val res1: scala.collection.immutable.TreeMap[String,String] = TreeMap(A -> 2)

res1 is wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants