while silly, we should be constistent
julia> 1[1,1]
1
julia> 1[end]
1
julia> [1][end, end]
1
julia> 1[end, end]
ERROR: MethodError: no method matching lastindex(::Int64, ::Int64)
I would like to work on this issue
You would just have to add a method lastindex(::Number, ::Int)
here, probably adopt the bounds check from size
and axes
right above and then just return 1
. Probably also a good idea to add a method to firstindex
with the same defintion.
Thanks for the pointer @simeonschaub
Most helpful comment
You would just have to add a method
lastindex(::Number, ::Int)
here, probably adopt the bounds check fromsize
andaxes
right above and then just return1
. Probably also a good idea to add a method tofirstindex
with the same defintion.