We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take a tuple, any old tuple, say (1,). Now try to getindex it with as many indices as you'd like.
(1,)
getindex
julia> (1,)[] # 0 indices ERROR: StackOverflowError: Stacktrace: [1] getindex(::Tuple{Int64}) at ./multidimensional.jl:0 [2] getindex(::Tuple{Int64}) at ./multidimensional.jl:387 (repeats 79999 times) julia> (1,)[1] # 1 index 1 julia> (1,)[1,1] # 2 indices ERROR: StackOverflowError: Stacktrace: [1] getindex(::Tuple{Int64}, ::Int64, ::Int64) at ./multidimensional.jl:0 [2] getindex(::Tuple{Int64}, ::Int64, ::Int64) at ./multidimensional.jl:387 (repeats 79999 times)
The offending definition is here, reproduced below:
getindex(t::Tuple, I...) = getindex(t, IteratorsMD.flatten(I)...)
It's pretty clear that this method will recurse infinitely since the only more specific getindex method for tuples is getindex(::Tuple, ::Integer).
getindex(::Tuple, ::Integer)
Tuples aren't really multidimensional objects, so it'd probably be best to stick with the one method.
The text was updated successfully, but these errors were encountered:
Removing non-linear indexing of tuples seems like a no-brainer to me, especially since it's currently too broken for it to actually be used anywhere.
Sorry, something went wrong.
No branches or pull requests
Take a tuple, any old tuple, say
(1,)
. Now try togetindex
it with as many indices as you'd like.The offending definition is here, reproduced below:
It's pretty clear that this method will recurse infinitely since the only more specific
getindex
method for tuples isgetindex(::Tuple, ::Integer)
.Tuples aren't really multidimensional objects, so it'd probably be best to stick with the one method.
The text was updated successfully, but these errors were encountered: