StaticArrays.jl icon indicating copy to clipboard operation
StaticArrays.jl copied to clipboard

StackOverflowError with setindex and multiple indices

Open Mrbigmatt opened this issue 3 years ago • 1 comments

This code (run with StaticArrays 1.5.0 and Julia 1.7.0) produces a StackOverflowError: setindex(SVector(1:3...), SVector(4:5...), 2:3) The above line used to work with StaticArrays v1.4.5 and earlier. I believe by dropping the "::Int" type specifier on the setindex function parameter a month ago (src/deque.jl), that causes the above line to use that function instead of another one in another package (ArrayInterfaceCore.jl - But apparently it returned an MVector...).

Note that this still works (just want to do the same with SVector): setindex!([1, 2, 3], SVector(4:5...), 2:3)

Regardless whether this was an intended feature or not, it shouldn't throw a StackOverflowError. This should also be a feature and it return the appropriate static array type.

Mrbigmatt avatar Jul 05 '22 07:07 Mrbigmatt

Yes, that's not good, I'll try to fix this.

mateuszbaran avatar Jul 07 '22 10:07 mateuszbaran