You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a zero-dimensional array a we usually expect a[] == a[1]. However this does not work with zero-D views of OffsetVectors
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]
2
This happens because for FastContiguousSubArrays, the indexing produces b[1] -> a[1]. Perhaps the offset calculation for the view needs to be different for OffsetVectors?
fixes the issue in this particular case, however I'm not sure if this holds in general. I wonder if this is the correct resolution? In that case I can consider a PR.