@@ -355,7 +355,6 @@ using OffsetArrays
355355 @test @inferred (dense_dims (@view (PermutedDimsArray (A,(3 ,1 ,2 ))[2 : 3 ,:,[1 ,2 ]]))) === ArrayInterface. DenseDims ((false ,true ,false ))
356356 @test @inferred (dense_dims (@view (PermutedDimsArray (A,(3 ,1 ,2 ))[2 : 3 ,[1 ,2 ,3 ],:]))) === ArrayInterface. DenseDims ((false ,false ,false ))
357357
358-
359358 B = Array {Int8} (undef, 2 ,2 ,2 ,2 );
360359 doubleperm = PermutedDimsArray (PermutedDimsArray (B,(4 ,2 ,3 ,1 )), (4 ,2 ,1 ,3 ));
361360 @test collect (strides (B))[collect (stride_rank (doubleperm))] == collect (strides (doubleperm))
@@ -368,11 +367,18 @@ end
368367 Sp2 = @view (PermutedDimsArray (S,(3 ,2 ,1 ))[2 : 3 ,:,:]);
369368 Mp2 = @view (PermutedDimsArray (M,(3 ,1 ,2 ))[2 : 3 ,:,2 ])' ;
370369 D = @view (A[:,2 : 2 : 4 ,:])
370+ R = StaticInt (1 ): StaticInt (2 )
371+ Rr = reinterpret (Int32, R)
372+ Ar = reinterpret (Float32, A)
371373
374+
372375 @test @inferred (ArrayInterface. size (A)) === (3 ,4 ,5 )
373376 @test @inferred (ArrayInterface. size (Ap)) === (2 ,5 )
374377 @test @inferred (ArrayInterface. size (A)) === size (A)
375378 @test @inferred (ArrayInterface. size (Ap)) === size (Ap)
379+ @test @inferred (ArrayInterface. size (R)) === (StaticInt (2 ),)
380+ @test @inferred (ArrayInterface. size (Rr)) === (StaticInt (4 ),)
381+
376382
377383 @test @inferred (ArrayInterface. size (S)) === (StaticInt (2 ), StaticInt (3 ), StaticInt (4 ))
378384 @test @inferred (ArrayInterface. size (Sp)) === (2 , 2 , StaticInt (3 ))
394400
395401 @test @inferred (ArrayInterface. known_size (A)) === (nothing , nothing , nothing )
396402 @test @inferred (ArrayInterface. known_size (Ap)) === (nothing ,nothing )
403+ @test @inferred (ArrayInterface. known_size (R)) === (2 ,)
404+ @test @inferred (ArrayInterface. known_size (Rr)) === (4 ,)
405+ @test @inferred (ArrayInterface. known_size (Ar)) === (nothing ,nothing , nothing ,)
397406
398407 @test @inferred (ArrayInterface. known_size (S)) === (2 , 3 , 4 )
399408 @test @inferred (ArrayInterface. known_size (Sp)) === (nothing , nothing , 3 )
410419 @test @inferred (ArrayInterface. strides (Ap)) === (StaticInt (1 ), 12 )
411420 @test @inferred (ArrayInterface. strides (A)) == strides (A)
412421 @test @inferred (ArrayInterface. strides (Ap)) == strides (Ap)
422+ @test @inferred (ArrayInterface. strides (Ar)) === (StaticInt {1} (), 6 , 24 )
423+
413424
414425 @test @inferred (ArrayInterface. strides (S)) === (StaticInt (1 ), StaticInt (2 ), StaticInt (6 ))
415426 @test @inferred (ArrayInterface. strides (Sp)) === (StaticInt (6 ), StaticInt (1 ), StaticInt (2 ))
427438
428439 @test @inferred (ArrayInterface. known_strides (A)) === (1 , nothing , nothing )
429440 @test @inferred (ArrayInterface. known_strides (Ap)) === (1 , nothing )
430-
441+ @test @inferred (ArrayInterface. known_strides (Ar)) === (1 , nothing , nothing )
442+
431443 @test @inferred (ArrayInterface. known_strides (S)) === (1 , 2 , 6 )
432444 @test @inferred (ArrayInterface. known_strides (Sp)) === (6 , 1 , 2 )
433445 @test @inferred (ArrayInterface. known_strides (Sp2)) === (6 , 2 , 1 )
441453
442454 @test @inferred (ArrayInterface. offsets (A)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
443455 @test @inferred (ArrayInterface. offsets (Ap)) === (StaticInt (1 ), StaticInt (1 ))
456+ @test @inferred (ArrayInterface. offsets (Ar)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
444457
445458 @test @inferred (ArrayInterface. offsets (S)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
446459 @test @inferred (ArrayInterface. offsets (Sp)) === (StaticInt (1 ), StaticInt (1 ), StaticInt (1 ))
452465
453466 @test @inferred (ArrayInterface. known_offsets (A)) === (1 , 1 , 1 )
454467 @test @inferred (ArrayInterface. known_offsets (Ap)) === (1 , 1 )
468+ @test @inferred (ArrayInterface. known_offsets (Ar)) === (1 , 1 , 1 )
455469
456470 @test @inferred (ArrayInterface. known_offsets (S)) === (1 , 1 , 1 )
457471 @test @inferred (ArrayInterface. known_offsets (Sp)) === (1 , 1 , 1 )
461475 @test @inferred (ArrayInterface. known_offsets (Mp)) === (1 , 1 )
462476 @test @inferred (ArrayInterface. known_offsets (Mp2)) === (1 , 1 )
463477
478+ @test @inferred (ArrayInterface. known_offsets (R)) === (1 ,)
479+ @test @inferred (ArrayInterface. known_offsets (Rr)) === (1 ,)
480+ @test @inferred (ArrayInterface. known_offsets (1 : 10 )) === (1 ,)
481+
464482 O = OffsetArray (A, 3 , 7 , 10 );
465483 Op = PermutedDimsArray (O,(3 ,1 ,2 ));
466484 @test @inferred (ArrayInterface. offsets (O)) === (4 , 8 , 11 )
0 commit comments