Skip to content

Commit d22d81c

Browse files
committed
Resolve ambiguities between checkbounds_indices methods.
1 parent 0e970f0 commit d22d81c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

base/multidimensional.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ end
258258
I::Tuple{AbstractArray{CartesianIndex{0}},Vararg{Any}})
259259
checkbounds_indices(Bool, IA, tail(I))
260260
end
261-
@inline function checkbounds_indices(::Type{Bool}, IA::Tuple{Any},
262-
I::Tuple{<:AbstractArray{<:CartesianIndex},Vararg{Any}})
261+
@inline function checkbounds_indices{N}(::Type{Bool}, IA::Tuple{Any},
262+
I::Tuple{AbstractArray{CartesianIndex{N}},Vararg{Any}})
263263
checkindex(Bool, IA, I[1]) & checkbounds_indices(Bool, (), tail(I))
264264
end
265265
@inline function checkbounds_indices{N}(::Type{Bool}, IA::Tuple,

test/abstractarray.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,3 +836,7 @@ end
836836
@testset "dispatch loop introduced in #19305" begin
837837
@test [(1:2) zeros(2,2); ones(3,3)] == [[1,2] zeros(2,2); ones(3,3)] == [reshape([1,2],2,1) zeros(2,2); ones(3,3)]
838838
end
839+
840+
@testset "checkbounds_indices method ambiguities #20989" begin
841+
@test Base.checkbounds_indices(Bool, (1:1,), ([CartesianIndex(1)],))
842+
end

0 commit comments

Comments
 (0)