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

Merge 2.12 to 2.13 #9084

Merged
merged 15 commits into from Jun 24, 2020
Merged

Merge 2.12 to 2.13 #9084

merged 15 commits into from Jun 24, 2020

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Jun 24, 2020

The new test uncovered a bug in the deprecated ++: method, which is fixed in the merge commit (fixes scala/bug#12054).

$> git log HEAD --oneline -n 1 | cat
d175aece08 Merge pull request #9080 from retronym/topic/reusable-instance

$> git log upstream/2.12.x --oneline -n 1 | cat
7632de0663 Merge pull request #9074 from retronym/ticket/12047

$> export MB=$(git merge-base HEAD upstream/2.12.x)

$> git log --graph --oneline $MB..upstream/2.12.x | cat
*   7632de0663 Merge pull request #9074 from retronym/ticket/12047
|\
| * 4fe011f006 HashMap bulk operations should retain existing keys
| * 141efea564 Add an additional test left-bias in for Set.+
* |   07260fe845 Merge pull request #9081 from retronym/backport-2.12.x
|\ \
| |/
|/|
| * 493168baed Rework recent, buggy change to immutable.TreeMap
|/
*   72e2d77174 Merge pull request #9075 from lrytz/fix
|\
| * 368ec741cc fix an oversight
|/
*   7599ff2db9 [nomerge] Merge pull request #9071 from lrytz/cleanups
|\
| * a359fd4c2a fix test flag
| * 51f96c9bcd remove unused value
* 8f583826a1 Merge pull request #9062 from retronym/treeset-union-intersect
* 762afa29e2 [backport] Refactor fix from prior commit
* 2a28a85310 [backport] Bulk ops on TreeSet, TreeMap prefer keys from the left

$> git merge 07260fe845 -s ours

$> git merge 7632de0663

retronym and others added 14 commits June 17, 2020 15:13
The test suite that aimed to bring all of our sets and maps into
line did not exercise code paths optimized for:

   collection.$op(collectionOfSameType)

This commit updates the test to:

   - add test variants that generate operands of the same type as the
     input collection
   - add "preserves identity" tests for set intersection
   - fix the resulting failures by flipping the operands
     in `RedBlackTree.{union,intersection}`

I've also added concrete test cases to `Tree{Map,Set}Test` that
are easier to review and that also exercise builders.
[backport] Bulk ops on TreeSet, TreeMap prefer keys from the left
... when the operand overwrites mapping with a key that is == but ne.

This is consistent with the super class implementation, which
was overridden in 2.12.11 for efficiency.

I also found a pair of ClassCastExceptions in the new implementations
of `HashMap.++:`, for instance:

```
case class C(a: Int)(override val toString: String); implicit val Ordering_C: Ordering[C] = Ordering.by(_.a); val c0l = C(0)("l"); val c0r = C(0)("r"); import collection.immutable._; println(HashMap((c0l, ())).++:(TreeMap((c0r, ()))))'; done
v2.12.10
Map(r -> ())
v2.12.11
java.lang.ClassCastException: scala.collection.immutable.HashMap$adder$1$ cannot be cast to scala.collection.immutable.HashMap
	at scala.collection.immutable.HashMap$adder$1$.<init>(HashMap.scala:215)
```
We need to favour keys from the left that equivalent (but ne),
while favouring values from the right.

(cherry picked from commit abd82a2)
[backport] Rework recent, buggy change to immutable.TreeMap
HashMap bulk operations should retain existing keys
@lrytz lrytz requested a review from retronym June 24, 2020 13:30
@scala-jenkins scala-jenkins added this to the 2.13.4 milestone Jun 24, 2020
@lrytz lrytz modified the milestones: 2.13.4, 2.13.3 Jun 24, 2020
@lrytz lrytz force-pushed the merge-2.12-to-2.13-jun-24 branch from 64c3ad0 to 223c359 Compare June 24, 2020 14:36
@SethTisue SethTisue added the prio:blocker release blocker (used only by core team, only near release time) label Jun 24, 2020
@lrytz lrytz modified the milestones: 2.13.3, 2.13.4 Jun 24, 2020
@SethTisue SethTisue removed the prio:blocker release blocker (used only by core team, only near release time) label Jun 24, 2020
@SethTisue SethTisue modified the milestones: 2.13.4, 2.13.3 Jun 24, 2020
@SethTisue
Copy link
Member

SethTisue commented Jun 24, 2020

We need to re-run the community build anyway because of the reflection thread-safety fix, and it seems a shame to leave the #12054 fix (which Lukas put in the merge commit) out of 2.13.3 when it's so similar to all the other Map ordering things. So, merging.

@SethTisue
Copy link
Member

/nothingtoseehere

@SethTisue SethTisue merged commit d23424c into scala:2.13.x Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants