Similar to #12039.
for v in v2.12.10 v2.12.11 v2.13.2; do echo $v; scala-ref $v -nc -e 'case class C(a: Int)(override val toString: String); val c0l = C(0)("l"); val c0r = C(0)("r"); import collection.immutable._; println(HashMap((c0l, ())).++(HashMap((c0r, ()))))'; done
v2.12.10
Map(l -> ())
v2.12.11
Map(r -> ())
v2.13.2
warning: 1 deprecation; re-run with -deprecation for details
HashMap(l -> ())
The test cases should cover all the optimized HashMap/HashMap add operations that internally use merge. (e.g. via HashMapBuilder.++, HashMap.++, HashMap.++: