Skip to content

Commit e55df11

Browse files
committed
fix: make the order of the keys in the Map deterministic
This was introduced in #23769 but it makes the following test fail: https://github.com/scala/scala3/blob/48bc891bd317a62956dc86297feb6e86a73083f6/tests/run/t4954.scala#L8
1 parent 5220499 commit e55df11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/scala/collection/Map.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ transparent trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C]
216216
*/
217217
protected trait GenKeySet { this: Set[K] =>
218218
// CC note: this is unavoidable to make the KeySet pure.
219-
private[MapOps] val allKeys = MapOps.this.keysIterator.toSet
219+
private[MapOps] val allKeys = MapOps.this.keysIterator.toList
220220
// We restore the lazy behavior in LazyKeySet
221221
def iterator: Iterator[K] =
222222
allKeys.iterator

0 commit comments

Comments
 (0)