Skip to content

Commit 7a45b60

Browse files
som-snyttjoroKr21
andcommitted
Restore ImmutableKeySet test
Co-authored-by: Georgi Krastev <joro.kr.21@gmail.com>
1 parent 7a67d21 commit 7a45b60

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/src/scala/collection/immutable/Map.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ trait MapOps[K, +V, +CC[X, +Y] <: MapOps[X, Y, CC, _], +C <: MapOps[K, V, CC, C]
142142
override def keySet: Set[K] = new ImmutableKeySet
143143

144144
/** The implementation class of the set returned by `keySet` */
145-
protected class ImmutableKeySet extends AbstractSet[K] with GenKeySet with DefaultSerializable {
145+
protected[immutable] class ImmutableKeySet extends AbstractSet[K] with GenKeySet with DefaultSerializable {
146146
def incl(elem: K): Set[K] = if (this(elem)) this else empty ++ this + elem
147147
def excl(elem: K): Set[K] = if (this(elem)) empty ++ this - elem else this
148148
}

library/src/scala/collection/immutable/Set.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ object Set extends IterableFactory[Set] {
106106
case s: Set2[E] => s
107107
case s: Set3[E] => s
108108
case s: Set4[E] => s
109-
//case s: MapOps[E @unchecked, _, _, _]#ImmutableKeySet => s
110109
case s: HashMap[E @unchecked, _]#HashKeySet => s
110+
case s: MapOps[E, Any, Map, Map[E, Any]]#ImmutableKeySet @unchecked => s
111111
// We also want `SortedSet` (and subclasses, such as `BitSet`)
112112
// to rebuild themselves, to avoid element type widening issues.
113113
case _ => newBuilder[E].addAll(it).result()

0 commit comments

Comments
 (0)