diff --git a/src/host/indexing.jl b/src/host/indexing.jl index 346c2a01..069bdc30 100644 --- a/src/host/indexing.jl +++ b/src/host/indexing.jl @@ -154,7 +154,7 @@ function gpu_checkindex_indices(A, IA::Tuple, I::Tuple) end function gpu_checkindex_indices(A, ::Tuple{}, I::Tuple) @inline - gpu_checkindex(A, OneTo(1), I[1])::Bool & gpu_checkindex_indices(A, (), tail(I)) + gpu_checkindex(A, Base.OneTo(1), I[1])::Bool & gpu_checkindex_indices(A, (), tail(I)) end gpu_checkindex_indices(A, IA::Tuple, ::Tuple{}) = (@inline; all(x->length(x)==1, IA)) gpu_checkindex_indices(A, ::Tuple{}, ::Tuple{}) = true diff --git a/test/testsuite/indexing.jl b/test/testsuite/indexing.jl index 7aa29758..f5a1a1eb 100644 --- a/test/testsuite/indexing.jl +++ b/test/testsuite/indexing.jl @@ -129,6 +129,12 @@ end @test_throws DimensionMismatch x[1:9,1:9,:,:] = y end + @testset "mismatching axes/indices" begin + a = rand(1,1) + @test compare(a->a[1:1], AT, a) + @test compare(a->a[1:1,1:1], AT, a) + @test compare(a->a[1:1,1:1,1:1], AT, a) + end end @testsuite "indexing find" (AT, eltypes)->begin