@@ -1569,18 +1569,18 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
15691569 * ''n'' times in `that`, then the first ''n'' occurrences of `x` will not form
15701570 * part of the result, but any following occurrences will.
15711571 */
1572- def diff [B >: A ](that : Seq [B ]): Array [A ] = mutable.ArraySeq .make(xs).diff(that).array. asInstanceOf [ Array [ A ] ]
1572+ def diff [B >: A ](that : Seq [B ]): Array [A ] = mutable.ArraySeq .make(xs).diff(that).toArray[ A ]
15731573
15741574 /** Computes the multiset intersection between this array and another sequence.
1575- *
1576- * @param that the sequence of elements to intersect with.
1577- * @return a new array which contains all elements of this array
1578- * which also appear in `that`.
1579- * If an element value `x` appears
1580- * ''n'' times in `that`, then the first ''n'' occurrences of `x` will be retained
1581- * in the result, but any following occurrences will be omitted.
1582- */
1583- def intersect [B >: A ](that : Seq [B ]): Array [A ] = mutable.ArraySeq .make(xs).intersect(that).array. asInstanceOf [ Array [ A ] ]
1575+ *
1576+ * @param that the sequence of elements to intersect with.
1577+ * @return a new array which contains all elements of this array
1578+ * which also appear in `that`.
1579+ * If an element value `x` appears
1580+ * ''n'' times in `that`, then the first ''n'' occurrences of `x` will be retained
1581+ * in the result, but any following occurrences will be omitted.
1582+ */
1583+ def intersect [B >: A ](that : Seq [B ]): Array [A ] = mutable.ArraySeq .make(xs).intersect(that).toArray[ A ]
15841584
15851585 /** Groups elements in fixed size blocks by passing a "sliding window"
15861586 * over them (as opposed to partitioning them, as is done in grouped.)
@@ -1592,7 +1592,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
15921592 * last element (which may be the only element) will be truncated
15931593 * if there are fewer than `size` elements remaining to be grouped.
15941594 */
1595- def sliding (size : Int , step : Int = 1 ): Iterator [Array [A ]] = mutable.ArraySeq .make(xs).sliding(size, step).map(_.array. asInstanceOf [ Array [ A ] ])
1595+ def sliding (size : Int , step : Int = 1 ): Iterator [Array [A ]] = mutable.ArraySeq .make(xs).sliding(size, step).map(_.toArray[ A ])
15961596
15971597 /** Iterates over combinations. A _combination_ of length `n` is a subsequence of
15981598 * the original array, with the elements taken in order. Thus, `Array("x", "y")` and `Array("y", "y")`
@@ -1609,7 +1609,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
16091609 * Array("a", "b", "b", "b", "c").combinations(2) == Iterator(Array(a, b), Array(a, c), Array(b, b), Array(b, c))
16101610 * }}}
16111611 */
1612- def combinations (n : Int ): Iterator [Array [A ]] = mutable.ArraySeq .make(xs).combinations(n).map(_.array. asInstanceOf [ Array [ A ] ])
1612+ def combinations (n : Int ): Iterator [Array [A ]] = mutable.ArraySeq .make(xs).combinations(n).map(_.toArray[ A ])
16131613
16141614 /** Iterates over distinct permutations.
16151615 *
@@ -1618,7 +1618,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
16181618 * Array("a", "b", "b").permutations == Iterator(Array(a, b, b), Array(b, a, b), Array(b, b, a))
16191619 * }}}
16201620 */
1621- def permutations : Iterator [Array [A ]] = mutable.ArraySeq .make(xs).permutations.map(_.array. asInstanceOf [ Array [ A ] ])
1621+ def permutations : Iterator [Array [A ]] = mutable.ArraySeq .make(xs).permutations.map(_.toArray[ A ])
16221622
16231623 // we have another overload here, so we need to duplicate this method
16241624 /** Tests whether this array contains the given sequence at a given index.
0 commit comments