Skip to content

Commit 1face3f

Browse files
committed
Remove scala.Product0.
The addition of that trait is not essential to Scala 3. While it can be argued that it should exist, there is nothing special in Scala 3 compared to Scala 2 that makes it necessary. In the spirit of reusing the Scala 2.13 standard library with as few deviations as possible, we therefore remove it. It could be added back when we revise the standard library on its own.
1 parent 01c9a8d commit 1face3f

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

library/src/scala/Product0.scala

Lines changed: 0 additions & 23 deletions
This file was deleted.

library/src/scala/Tuple.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,16 @@ object Tuple {
248248
/** A tuple of 0 elements */
249249
type EmptyTuple = EmptyTuple.type
250250

251-
/** A tuple of 0 elements; the canonical representation of a [[scala.Product0]]. */
252-
object EmptyTuple extends Tuple with Product0 {
251+
/** A tuple of 0 elements. */
252+
object EmptyTuple extends Tuple {
253+
override def productArity: Int = 0
254+
255+
@throws(classOf[IndexOutOfBoundsException])
256+
override def productElement(n: Int): Any =
257+
throw new IndexOutOfBoundsException(n.toString())
258+
253259
def canEqual(that: Any): Boolean = this == that
260+
254261
override def toString(): String = "()"
255262
}
256263

0 commit comments

Comments
 (0)