-
-
Couldn't load subscription status.
- Fork 5.7k
Closed
Closed
Copy link
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior
Description
This is the same issue reported in OffsetArrays, but I'm posting it here as I'm not sure if the fix should go into Base. Please close this if it's more appropriate for the fix to be in OffsetArrays.
For a zero-dimensional array a we usually expect a[] == a[1]. However this does not work with zero-D views of OffsetVectors
julia> using OffsetArrays
julia> a = OffsetArray(1:3, 0:2);
julia> b = @view a[0]
0-dimensional view(OffsetArray(::UnitRange{Int64}, 0:2), 0) with eltype Int64:
1
julia> b[]
1
julia> b[1]
2Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior