-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Found this...
julia> import ArrayInterface: StaticInt
julia> r = StaticInt(1):4
StaticInt{1}():StaticInt{1}():4
julia> broadcast(-, r, StaticInt(1))
ERROR: StackOverflowError:
Stacktrace:
[1] UnitRange{StaticInt{0}}(::StaticInt{0}, ::StaticInt{3}) at /Users/zchristensen/.julia/packages/ArrayInterface/NbkVT/src/static.jl:108 (repeats 79984 times)
...and traced the issue back to Base._range assuming that UnitRange
should be formed with an element type that is a StaticInt
.
The easiest way to fix this would be our own Base._range(::StaticInt, ...)
, but I'm not sure if that's a good entry point since it's not public API.
Edit:
also found this
julia> (StaticInt(1):10)[1:2:6]
ERROR: MethodError: no method matching StepRange{StaticInt{1},Int64}(::StaticInt{1}, ::Int64, ::StaticInt{5})
Closest candidates are:
StepRange{StaticInt{1},Int64}(::T, ::S, ::T) where {T, S} at range.jl:204
Stacktrace:
[1] _rangestyle(::Base.Ordered, ::Base.ArithmeticWraps, ::StaticInt{1}, ::Int64, ::Int64) at ./range.jl:118
[2] _range at ./range.jl:116 [inlined]
[3] #range#43 at ./range.jl:91 [inlined]
[4] getindex(::ArrayInterface.OptionallyStaticUnitRange{StaticInt{1},Int64}, ::StepRange{Int64,Int64}) at ./range.jl:713
[5] top-level scope at REPL[26]:1
Metadata
Metadata
Assignees
Labels
No labels