Is this expected behavior?
julia> idx = UInt(3); A = rand(4); A[idx]
0.10882052381690266
julia> idx = (UInt(3), UInt(1)); A = rand(4, 5); A[idx]
ERROR: ArgumentError: invalid index: (0x0000000000000003, 0x0000000000000001) of type Tuple{UInt64,UInt64}
Stacktrace:
[1] to_index(::Tuple{UInt64,UInt64}) at .\indices.jl:297
[2] to_index(::Array{Float64,2}, ::Tuple{UInt64,UInt64}) at .\indices.jl:274
[3] to_indices at .\indices.jl:325 [inlined]
[4] to_indices at .\indices.jl:322 [inlined]
[5] getindex(::Array{Float64,2}, ::Tuple{UInt64,UInt64}) at .\abstractarray.jl:1060
[6] top-level scope at none:1
I’m writing a function that I would like to work with with UInt
or Int
arrays as input, but this issue (and an analogous one when using get(A, idx, 0)
) is getting in the way.