Skip to content

Commit 38f5cb7

Browse files
committed
Change the signature of Array.unapplySeq for the benefits of Scala 3
Fixes scala/scala3#14693, see discussion in the issue.
1 parent c8ee991 commit 38f5cb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/library/scala/Array.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,9 @@ object Array {
574574
* @param x the selector value
575575
* @return sequence wrapped in a [[scala.Some]], if `x` is an Array, otherwise `None`
576576
*/
577-
def unapplySeq[T](x: Array[T]): UnapplySeqWrapper[T] = new UnapplySeqWrapper(x)
577+
def unapplySeq[T](x: Array[_ <: T]): UnapplySeqWrapper[T] = new UnapplySeqWrapper(x)
578578

579-
final class UnapplySeqWrapper[T](private val a: Array[T]) extends AnyVal {
579+
final class UnapplySeqWrapper[T](private val a: Array[_ <: T]) extends AnyVal {
580580
def isEmpty: false = false
581581
def get: UnapplySeqWrapper[T] = this
582582
def lengthCompare(len: Int): Int = a.lengthCompare(len)

0 commit comments

Comments
 (0)