Skip to content

Commit 3f40bff

Browse files
committed
Revert the implicit dummy params added for Dotty
Since scala/scala3#6079, Dotty generates mixin forwarders after erasure just like Scala 2, so they don't cause extra name clashes, therefore we can revert 4366332 and e3ef657.
1 parent 7cc6dcb commit 3f40bff

File tree

7 files changed

+8
-16
lines changed

7 files changed

+8
-16
lines changed

src/library/scala/collection/BitSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ trait BitSetOps[+C <: BitSet with BitSetOps[C]]
234234
coll.fromBitMaskNoCopy(a)
235235
}
236236

237-
override def concat(other: collection.IterableOnce[Int])(implicit dummy: DummyImplicit): C = other match {
237+
override def concat(other: collection.IterableOnce[Int]): C = other match {
238238
case otherBitset: BitSet =>
239239
val len = coll.nwords max otherBitset.nwords
240240
val words = new Array[Long](len)

src/library/scala/collection/Map.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,8 @@ trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C]
311311
fromSpecific(this.view.filterKeys(k => !keysSet.contains(k)))
312312
}
313313

314-
// The implicit dummy parameter is necessary to avoid erased signature clashes
315-
// between this `++:` and the overload overriden below.
316-
// Note that these clashes only happen in Dotty because it adds mixin
317-
// forwarders before erasure unlike Scala 2.
318314
@deprecated("Use ++ instead of ++: for collections of type Iterable", "2.13.0")
319-
def ++: [V1 >: V](that: IterableOnce[(K,V1)])(implicit dummy: DummyImplicit): CC[K,V1] = {
315+
def ++: [V1 >: V](that: IterableOnce[(K,V1)]): CC[K,V1] = {
320316
val thatIterable: Iterable[(K, V1)] = that match {
321317
case that: Iterable[(K, V1)] => that
322318
case that => View.from(that)

src/library/scala/collection/Set.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@ trait SetOps[A, +CC[_], +C <: SetOps[A, CC, C]]
177177
@deprecated("Use &- with an explicit collection argument instead of - with varargs", "2.13.0")
178178
def - (elem1: A, elem2: A, elems: A*): C = diff(elems.toSet + elem1 + elem2)
179179

180-
// The implicit dummy parameter is necessary to avoid erased signature clashes
181-
// between this `concat` and the polymorphic one defined in `IterableOps`.
182-
// Note that these clashes only happen in Dotty because it adds mixin
183-
// forwarders before erasure unlike Scala 2.
184180
/** Creates a new $coll by adding all elements contained in another collection to this $coll, omitting duplicates.
185181
*
186182
* This method takes a collection of elements and adds all elements, omitting duplicates, into $coll.
@@ -194,7 +190,7 @@ trait SetOps[A, +CC[_], +C <: SetOps[A, CC, C]]
194190
* @param that the collection containing the elements to add.
195191
* @return a new $coll with the given elements added, omitting duplicates.
196192
*/
197-
def concat(that: collection.IterableOnce[A])(implicit dummy: DummyImplicit): C = fromSpecific(that match {
193+
def concat(that: collection.IterableOnce[A]): C = fromSpecific(that match {
198194
case that: collection.Iterable[A] => new View.Concat(toIterable, that)
199195
case _ => iterator.concat(that.iterator)
200196
})
@@ -206,7 +202,7 @@ trait SetOps[A, +CC[_], +C <: SetOps[A, CC, C]]
206202
def + (elem1: A, elem2: A, elems: A*): C = fromSpecific(new View.Concat(new View.Appended(new View.Appended(toIterable, elem1), elem2), elems))
207203

208204
/** Alias for `concat` */
209-
@`inline` final def ++ (that: collection.IterableOnce[A])(implicit dummy: DummyImplicit): C = concat(that)
205+
@`inline` final def ++ (that: collection.IterableOnce[A]): C = concat(that)
210206

211207
/** Computes the union between of set and another set.
212208
*

src/library/scala/collection/StrictOptimizedSetOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ trait StrictOptimizedSetOps[A, +CC[_], +C <: SetOps[A, CC, C]]
2323
extends SetOps[A, CC, C]
2424
with StrictOptimizedIterableOps[A, CC, C] {
2525

26-
override def concat(that: IterableOnce[A])(implicit dummy: DummyImplicit): C =
26+
override def concat(that: IterableOnce[A]): C =
2727
strictOptimizedConcat(that, newSpecificBuilder)
2828

2929
}

src/library/scala/collection/immutable/HashSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ final class HashSet[A] private[immutable] (val rootNode: SetNode[A])
7878
newHashSetOrThis(newRootNode)
7979
}
8080

81-
override def concat(that: IterableOnce[A])(implicit dummy: DummyImplicit): HashSet[A] =
81+
override def concat(that: IterableOnce[A]): HashSet[A] =
8282
that match {
8383
case hs: HashSet[A] => newHashSetOrThis(rootNode.concat(hs.rootNode, 0))
8484
case _ => super.concat(that)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ trait StrictOptimizedSetOps[A, +CC[X], +C <: SetOps[A, CC, C]]
7979
with collection.StrictOptimizedSetOps[A, CC, C]
8080
with StrictOptimizedIterableOps[A, CC, C] {
8181

82-
override def concat(that: collection.IterableOnce[A])(implicit dummy: DummyImplicit): C = {
82+
override def concat(that: collection.IterableOnce[A]): C = {
8383
var result: C = coll
8484
val it = that.iterator
8585
while (it.hasNext) result = result + it.next()

src/library/scala/collection/immutable/TreeSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ final class TreeSet[A] private[immutable] (private[immutable] val tree: RB.Tree[
141141
def excl(elem: A): TreeSet[A] =
142142
newSetOrSelf(RB.delete(tree, elem))
143143

144-
override def concat(that: collection.IterableOnce[A])(implicit dummy: DummyImplicit): TreeSet[A] = {
144+
override def concat(that: collection.IterableOnce[A]): TreeSet[A] = {
145145
val t = that match {
146146
case ts: TreeSet[A] if ordering == ts.ordering =>
147147
RB.union(tree, ts.tree)

0 commit comments

Comments
 (0)