@@ -113,7 +113,7 @@ object ArrayOps {
113113 b.result()
114114 }
115115
116- def flatMap [BS , B ](f : A => BS )(implicit asIterable : BS => Iterable [B ], m : ClassTag [B ]): Array [B ] =
116+ def flatMap [BS , B ](f : A => BS )(implicit asIterable : BS => Iterable [B ], m : ClassTag [B ]): Array [B ] =
117117 flatMap[B ](x => asIterable(f(x)))
118118
119119 /** Creates a new non-strict filter which combines this filter with the given predicate. */
@@ -505,7 +505,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
505505 *
506506 * @return a pair of arrays: the first one made of those values returned by `f` that were wrapped in [[scala.util.Left ]],
507507 * and the second one made of those wrapped in [[scala.util.Right ]]. */
508- def partitionMap [A1 : ClassTag , A2 : ClassTag ](f : A => Either [A1 , A2 ]): (Array [A1 ], Array [A2 ]) = {
508+ def partitionMap [A1 : ClassTag , A2 : ClassTag ](f : A => Either [A1 , A2 ]): (Array [A1 ], Array [A2 ]) = {
509509 val res1 = ArrayBuilder .make[A1 ]
510510 val res2 = ArrayBuilder .make[A2 ]
511511 var i = 0
@@ -816,7 +816,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
816816 * }}}
817817 *
818818 */
819- def scanLeft [B : ClassTag ](z : B )(op : (B , A ) => B ): Array [B ] = {
819+ def scanLeft [ B : ClassTag ](z : B )(op : (B , A ) => B ): Array [B ] = {
820820 var v = z
821821 var i = 0
822822 val res = new Array [B ](xs.length + 1 )
@@ -855,7 +855,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
855855 * }}}
856856 *
857857 */
858- def scanRight [B : ClassTag ](z : B )(op : (A , B ) => B ): Array [B ] = {
858+ def scanRight [ B : ClassTag ](z : B )(op : (A , B ) => B ): Array [B ] = {
859859 var v = z
860860 var i = xs.length - 1
861861 val res = new Array [B ](xs.length + 1 )
@@ -973,7 +973,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
973973 b.result()
974974 }
975975
976- def flatMap [BS , B ](f : A => BS )(implicit asIterable : BS => Iterable [B ], m : ClassTag [B ]): Array [B ] =
976+ def flatMap [BS , B ](f : A => BS )(implicit asIterable : BS => Iterable [B ], m : ClassTag [B ]): Array [B ] =
977977 flatMap[B ](x => asIterable(f(x)))
978978
979979 /** Flattens a two-dimensional array by concatenating all its rows
@@ -1095,7 +1095,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
10951095 * If this array is shorter than `that`, `thisElem` values are used to pad the result.
10961096 * If `that` is shorter than this array, `thatElem` values are used to pad the result.
10971097 */
1098- def zipAll [A1 >: A , B ](that : Iterable [B ], thisElem : A1 , thatElem : B ): Array [(A1 , B )] = {
1098+ def zipAll [A1 >: A , B ](that : Iterable [B ], thisElem : A1 , thatElem : B ): Array [(A1 , B )] = {
10991099 val b = new ArrayBuilder .ofRef[(A1 , B )]()
11001100 val k = that.knownSize
11011101 b.sizeHint(max(k, xs.length))
@@ -1244,7 +1244,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
12441244 * @return a pair of Arrays, containing, respectively, the first and second half
12451245 * of each element pair of this Array.
12461246 */
1247- def unzip [A1 , A2 ](implicit asPair : A => (A1 , A2 ), ct1 : ClassTag [A1 ], ct2 : ClassTag [A2 ]): (Array [A1 ], Array [A2 ]) = {
1247+ def unzip [A1 , A2 ](implicit asPair : A => (A1 , A2 ), ct1 : ClassTag [A1 ], ct2 : ClassTag [A2 ]): (Array [A1 ], Array [A2 ]) = {
12481248 val a1 = new Array [A1 ](xs.length)
12491249 val a2 = new Array [A2 ](xs.length)
12501250 var i = 0
@@ -1273,7 +1273,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
12731273 * @return a triple of Arrays, containing, respectively, the first, second, and third
12741274 * elements from each element triple of this Array.
12751275 */
1276- def unzip3 [A1 , A2 , A3 ](implicit asTriple : A => (A1 , A2 , A3 ), ct1 : ClassTag [A1 ], ct2 : ClassTag [A2 ],
1276+ def unzip3 [A1 , A2 , A3 ](implicit asTriple : A => (A1 , A2 , A3 ), ct1 : ClassTag [A1 ], ct2 : ClassTag [A2 ],
12771277 ct3 : ClassTag [A3 ]): (Array [A1 ], Array [A2 ], Array [A3 ]) = {
12781278 val a1 = new Array [A1 ](xs.length)
12791279 val a2 = new Array [A2 ](xs.length)
@@ -1418,7 +1418,7 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
14181418 * @tparam K the type of keys returned by the discriminator function
14191419 * @tparam B the type of values returned by the transformation function
14201420 */
1421- def groupMap [K , B : ClassTag ](key : A => K )(f : A => B ): immutable.Map [K , Array [B ]] = {
1421+ def groupMap [K , B : ClassTag ](key : A => K )(f : A => B ): immutable.Map [K , Array [B ]] = {
14221422 val m = mutable.Map .empty[K , ArrayBuilder [B ]]
14231423 val len = xs.length
14241424 var i = 0
@@ -1479,7 +1479,8 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
14791479 /** Create a copy of this array with the specified element type. */
14801480 def toArray [B >: A : ClassTag ]: Array [B ] = {
14811481 val destination = new Array [B ](xs.length)
1482- copyToArray(destination, 0 )
1482+ @ annotation.unused val copied = copyToArray(destination, 0 )
1483+ // assert(copied == xs.length)
14831484 destination
14841485 }
14851486
0 commit comments