@@ -336,25 +336,17 @@ object IArray:
336
336
private inline def mapNull [A , B ](a : A , inline f : B ): B =
337
337
if ((a : A | Null ) == null ) null .asInstanceOf [B ] else f
338
338
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 */
346
345
implicit def genericWrapArray [T ](arr : IArray [T ]): ArraySeq [T ] =
347
346
mapNull(arr, ArraySeq .unsafeWrapArray(arr))
348
347
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!
358
350
implicit def wrapRefArray [T <: AnyRef | Null ](arr : IArray [T ]): ArraySeq .ofRef[T ] =
359
351
// Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef | Null]
360
352
// is as good as another for all T <: AnyRef | Null. Instead of creating 100,000,000
@@ -365,93 +357,39 @@ object IArray:
365
357
else ArraySeq .ofRef[AnyRef ](arr.asInstanceOf [Array [AnyRef ]]).asInstanceOf [ArraySeq .ofRef[T ]]
366
358
)
367
359
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 */
375
361
implicit def wrapIntArray (arr : IArray [Int ]): ArraySeq .ofInt =
376
362
mapNull(arr, new ArraySeq .ofInt(arr.asInstanceOf [Array [Int ]]))
377
363
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 */
385
365
implicit def wrapDoubleIArray (arr : IArray [Double ]): ArraySeq .ofDouble =
386
366
mapNull(arr, new ArraySeq .ofDouble(arr.asInstanceOf [Array [Double ]]))
387
367
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 */
395
369
implicit def wrapLongIArray (arr : IArray [Long ]): ArraySeq .ofLong =
396
370
mapNull(arr, new ArraySeq .ofLong(arr.asInstanceOf [Array [Long ]]))
397
371
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 */
405
373
implicit def wrapFloatIArray (arr : IArray [Float ]): ArraySeq .ofFloat =
406
374
mapNull(arr, new ArraySeq .ofFloat(arr.asInstanceOf [Array [Float ]]))
407
375
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 */
415
377
implicit def wrapCharIArray (arr : IArray [Char ]): ArraySeq .ofChar =
416
378
mapNull(arr, new ArraySeq .ofChar(arr.asInstanceOf [Array [Char ]]))
417
379
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 */
425
381
implicit def wrapByteIArray (arr : IArray [Byte ]): ArraySeq .ofByte =
426
382
mapNull(arr, new ArraySeq .ofByte(arr.asInstanceOf [Array [Byte ]]))
427
383
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 */
435
385
implicit def wrapShortIArray (arr : IArray [Short ]): ArraySeq .ofShort =
436
386
mapNull(arr, new ArraySeq .ofShort(arr.asInstanceOf [Array [Short ]]))
437
387
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 */
445
389
implicit def wrapBooleanIArray (arr : IArray [Boolean ]): ArraySeq .ofBoolean =
446
390
mapNull(arr, new ArraySeq .ofBoolean(arr.asInstanceOf [Array [Boolean ]]))
447
391
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 */
455
393
implicit def wrapUnitIArray (arr : IArray [Unit ]): ArraySeq .ofUnit =
456
394
mapNull(arr, new ArraySeq .ofUnit(arr.asInstanceOf [Array [Unit ]]))
457
395
0 commit comments