Skip to content

Commit dd486ca

Browse files
Resolve checkbounds ambiguities with Base.LogicalIndex (see JuliaMath/Interpolations.jl@650a596)
1 parent 8301e61 commit dd486ca

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/CommonDataModel.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using Printf
88
using Preferences
99
using DataStructures
1010
import Base:
11+
LogicalIndex,
1112
checkbounds,
1213
close,
1314
collect,

src/memory_dataset.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ import CommonDataModel as CDM
22

33
Base.size(RA::ResizableArray) = size(RA.A)
44
Base.getindex(RA::ResizableArray,inds...) = getindex(RA.A,inds...)
5-
Base.checkbounds(::Type{Bool},RA::ResizableArray,inds::Union{Integer,AbstractVector{<:Integer}}...) = all(minimum.(inds) .> 0)
5+
6+
@inline _checkbounds(RA::ResizableArray,inds...) = all(minimum.(inds) .> 0)
7+
8+
@inline Base.checkbounds(::Type{Bool},RA::ResizableArray,inds::Union{Integer,AbstractVector{<:Integer}}...) =
9+
_checkbounds(RA,inds...)
10+
11+
@inline checkbounds(::Type{Bool}, itp::ResizableArray, inds::LogicalIndex) =
12+
_checkbounds(RA,inds...)
13+
14+
@inline checkbounds(::Type{Bool}, itp::ResizableArray, inds::LogicalIndex{<:Any,<:AbstractVector{Bool}}) =
15+
_checkbounds(RA,inds...)
616

717
function grow!(RA::ResizableArray{T,N},new_size) where {T,N}
818
# grow

0 commit comments

Comments
 (0)