You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
findfirst appears to sometimes break, e.g., in this MWE:
julia>using IdentityRanges
julia>findfirst(x -> x <0, IdentityRange(-2:2))
ERROR: BoundsError: attempt to access 5-element IdentityRange{Int64} with indices -2:2 at index [3]
Stacktrace:
[1] throw_boundserror(::IdentityRange{Int64}, ::Int64) at ./abstractarray.jl:541
[2] getindex at /Users/dahong67/.julia/packages/IdentityRanges/liKDH/src/IdentityRanges.jl:70 [inlined]
[3] findnext(::var"#9#10", ::IdentityRange{Int64}, ::Int64) at ./array.jl:1810
[4] findfirst(::Function, ::IdentityRange{Int64}) at ./array.jl:1861
[5] top-level scope at REPL[8]:1
Similarly for findlast, findall.
It seems to happen because keys currently always start at 1:
findfirst
appears to sometimes break, e.g., in this MWE:Similarly for
findlast
,findall
.It seems to happen because
keys
currently always start at 1:Is this the intended behavior?
Interestingly, related to #9,
Base.IdentityUnitRange
behaves differently:The text was updated successfully, but these errors were encountered: