InfiniteArrays.jl
InfiniteArrays.jl copied to clipboard
findfirst doesn't work for infranges with negative step sizes
julia> using InfiniteArrays
julia> findfirst(==(9), 10:-1:-∞)
julia> findfirst(==(11), 10:-1:-∞)
0
julia> findfirst(==(21), 10:-1:-∞)
-10
julia> (10:-1:-∞)[-10]
ERROR: BoundsError: attempt to access ℵ₀-element InfiniteArrays.InfStepRange{Int64, Int64} with indices OneToInf() at index [-10]
Stacktrace:
[1] throw_boundserror(A::InfiniteArrays.InfStepRange{Int64, Int64}, I::Int64)
@ Base .\abstractarray.jl:737
[2] getindex(v::InfiniteArrays.InfStepRange{Int64, Int64}, i::Int64)
@ InfiniteArrays C:\Users\User\.julia\packages\InfiniteArrays\heAfT\src\infrange.jl:213
[3] top-level scope
@ REPL[18]:1