@@ -336,25 +336,17 @@ object IArray:
336336 private inline def mapNull [A , B ](a : A , inline f : B ): B =
337337 if ((a : A | Null ) == null ) null .asInstanceOf [B ] else f
338338
339- /** Conversion from IArray to immutable.ArraySeq.
340- *
341- * Note: Both the parameter and the return type are non-nullable. However, if a null
342- * reference is passed explicitly, this method will still return null. We intentionally
343- * keep this signature to discourage passing nulls implicitly while preserving the
344- * previous behavior for backward compatibility.
345- */
339+ // For the following functions, both the parameter and the return type are non-nullable.
340+ // However, if a null reference is passed explicitly, this method will still return null.
341+ // We intentionally keep this signature to discourage passing nulls implicitly while
342+ // preserving the previous behavior for backward compatibility.
343+
344+ /** Conversion from IArray to immutable.ArraySeq */
346345 implicit def genericWrapArray [T ](arr : IArray [T ]): ArraySeq [T ] =
347346 mapNull(arr, ArraySeq .unsafeWrapArray(arr))
348347
349- /** Conversion from IArray to immutable.ArraySeq.
350- *
351- * Note: Both the parameter and the return type are non-nullable. However, if a null
352- * reference is passed explicitly, this method will still return null. We intentionally
353- * keep this signature to discourage passing nulls implicitly while preserving the
354- * previous behavior for backward compatibility.
355- */
356- // TODO!!! only for stdliib migration!
357- import scala .language .unsafeNulls
348+ /** Conversion from IArray to immutable.ArraySeq */
349+ import scala .language .unsafeNulls // TODO!!! only for stdliib migration!
358350 implicit def wrapRefArray [T <: AnyRef | Null ](arr : IArray [T ]): ArraySeq .ofRef[T ] =
359351 // Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef | Null]
360352 // is as good as another for all T <: AnyRef | Null. Instead of creating 100,000,000
@@ -365,93 +357,39 @@ object IArray:
365357 else ArraySeq .ofRef[AnyRef ](arr.asInstanceOf [Array [AnyRef ]]).asInstanceOf [ArraySeq .ofRef[T ]]
366358 )
367359
368- /** Conversion from IArray to immutable.ArraySeq.
369- *
370- * Note: Both the parameter and the return type are non-nullable. However, if a null
371- * reference is passed explicitly, this method will still return null. We intentionally
372- * keep this signature to discourage passing nulls implicitly while preserving the
373- * previous behavior for backward compatibility.
374- */
360+ /** Conversion from IArray to immutable.ArraySeq */
375361 implicit def wrapIntArray (arr : IArray [Int ]): ArraySeq .ofInt =
376362 mapNull(arr, new ArraySeq .ofInt(arr.asInstanceOf [Array [Int ]]))
377363
378- /** Conversion from IArray to immutable.ArraySeq.
379- *
380- * Note: Both the parameter and the return type are non-nullable. However, if a null
381- * reference is passed explicitly, this method will still return null. We intentionally
382- * keep this signature to discourage passing nulls implicitly while preserving the
383- * previous behavior for backward compatibility.
384- */
364+ /** Conversion from IArray to immutable.ArraySeq */
385365 implicit def wrapDoubleIArray (arr : IArray [Double ]): ArraySeq .ofDouble =
386366 mapNull(arr, new ArraySeq .ofDouble(arr.asInstanceOf [Array [Double ]]))
387367
388- /** Conversion from IArray to immutable.ArraySeq.
389- *
390- * Note: Both the parameter and the return type are non-nullable. However, if a null
391- * reference is passed explicitly, this method will still return null. We intentionally
392- * keep this signature to discourage passing nulls implicitly while preserving the
393- * previous behavior for backward compatibility.
394- */
368+ /** Conversion from IArray to immutable.ArraySeq */
395369 implicit def wrapLongIArray (arr : IArray [Long ]): ArraySeq .ofLong =
396370 mapNull(arr, new ArraySeq .ofLong(arr.asInstanceOf [Array [Long ]]))
397371
398- /** Conversion from IArray to immutable.ArraySeq.
399- *
400- * Note: Both the parameter and the return type are non-nullable. However, if a null
401- * reference is passed explicitly, this method will still return null. We intentionally
402- * keep this signature to discourage passing nulls implicitly while preserving the
403- * previous behavior for backward compatibility.
404- */
372+ /** Conversion from IArray to immutable.ArraySeq */
405373 implicit def wrapFloatIArray (arr : IArray [Float ]): ArraySeq .ofFloat =
406374 mapNull(arr, new ArraySeq .ofFloat(arr.asInstanceOf [Array [Float ]]))
407375
408- /** Conversion from IArray to immutable.ArraySeq.
409- *
410- * Note: Both the parameter and the return type are non-nullable. However, if a null
411- * reference is passed explicitly, this method will still return null. We intentionally
412- * keep this signature to discourage passing nulls implicitly while preserving the
413- * previous behavior for backward compatibility.
414- */
376+ /** Conversion from IArray to immutable.ArraySeq */
415377 implicit def wrapCharIArray (arr : IArray [Char ]): ArraySeq .ofChar =
416378 mapNull(arr, new ArraySeq .ofChar(arr.asInstanceOf [Array [Char ]]))
417379
418- /** Conversion from IArray to immutable.ArraySeq.
419- *
420- * Note: Both the parameter and the return type are non-nullable. However, if a null
421- * reference is passed explicitly, this method will still return null. We intentionally
422- * keep this signature to discourage passing nulls implicitly while preserving the
423- * previous behavior for backward compatibility.
424- */
380+ /** Conversion from IArray to immutable.ArraySeq */
425381 implicit def wrapByteIArray (arr : IArray [Byte ]): ArraySeq .ofByte =
426382 mapNull(arr, new ArraySeq .ofByte(arr.asInstanceOf [Array [Byte ]]))
427383
428- /** Conversion from IArray to immutable.ArraySeq.
429- *
430- * Note: Both the parameter and the return type are non-nullable. However, if a null
431- * reference is passed explicitly, this method will still return null. We intentionally
432- * keep this signature to discourage passing nulls implicitly while preserving the
433- * previous behavior for backward compatibility.
434- */
384+ /** Conversion from IArray to immutable.ArraySeq */
435385 implicit def wrapShortIArray (arr : IArray [Short ]): ArraySeq .ofShort =
436386 mapNull(arr, new ArraySeq .ofShort(arr.asInstanceOf [Array [Short ]]))
437387
438- /** Conversion from IArray to immutable.ArraySeq.
439- *
440- * Note: Both the parameter and the return type are non-nullable. However, if a null
441- * reference is passed explicitly, this method will still return null. We intentionally
442- * keep this signature to discourage passing nulls implicitly while preserving the
443- * previous behavior for backward compatibility.
444- */
388+ /** Conversion from IArray to immutable.ArraySeq */
445389 implicit def wrapBooleanIArray (arr : IArray [Boolean ]): ArraySeq .ofBoolean =
446390 mapNull(arr, new ArraySeq .ofBoolean(arr.asInstanceOf [Array [Boolean ]]))
447391
448- /** Conversion from IArray to immutable.ArraySeq.
449- *
450- * Note: Both the parameter and the return type are non-nullable. However, if a null
451- * reference is passed explicitly, this method will still return null. We intentionally
452- * keep this signature to discourage passing nulls implicitly while preserving the
453- * previous behavior for backward compatibility.
454- */
392+ /** Conversion from IArray to immutable.ArraySeq */
455393 implicit def wrapUnitIArray (arr : IArray [Unit ]): ArraySeq .ofUnit =
456394 mapNull(arr, new ArraySeq .ofUnit(arr.asInstanceOf [Array [Unit ]]))
457395
0 commit comments