@@ -391,15 +391,17 @@ if (isIterable!Iterable)
391
391
@safe pure nothrow unittest
392
392
{
393
393
import std.range : only;
394
- int [3 ] arr = only(1 , 2 , 3 ).staticArray! 3 ;
394
+ auto arr = only(1 , 2 , 3 ).staticArray! 3 ;
395
+ static assert (is (typeof (arr) == int [3 ]));
395
396
assert (arr == [ 1 , 2 , 3 ]);
396
397
}
397
398
398
399
// / If the range has more than `n` elements, `staticArray` takes only `n`
399
400
@safe pure nothrow unittest
400
401
{
401
402
import std.range : take, repeat;
402
- int [4 ] arr = repeat(5 ).staticArray! 4 ;
403
+ auto arr = repeat(5 ).staticArray! 4 ;
404
+ static assert (is (typeof (arr) == int [4 ]));
403
405
assert (arr == [ 5 , 5 , 5 , 5 ]);
404
406
}
405
407
@@ -413,7 +415,7 @@ pure unittest
413
415
assertThrown! AssertError (only(1 ,2 ,3 ).staticArray! 5 );
414
416
415
417
// extend the range to the desired length before handing it to staticArray
416
- int [ 5 ] arr = only(1 ,2 ,3 ).chain(0. repeat).staticArray! 5 ;
418
+ auto arr = only(1 ,2 ,3 ).chain(0. repeat).staticArray! 5 ;
417
419
assert (arr == [ 1 , 2 , 3 , 0 , 0 ]);
418
420
}
419
421
@@ -435,7 +437,8 @@ unittest
435
437
}
436
438
}
437
439
438
- int [5 ] arr = OpApply().staticArray! 5 ;
440
+ auto arr = OpApply().staticArray! 5 ;
441
+ static assert (is (typeof (arr) == int [5 ]));
439
442
assert (arr == [ 0 , 1 , 2 , 3 , 4 ]);
440
443
}
441
444
0 commit comments