This is the same issue as OffsetArrays#186, but I believe the fix should go into Base. We use the axis type IdOffsetRange defined in OffsetArrays to construct the view.
julia> using OffsetArrays
julia> using OffsetArrays: IdOffsetRange
julia> a = reshape(1:12, 3, 4)
3×4 reshape(::UnitRange{Int64}, 3, 4) with eltype Int64:
1 4 7 10
2 5 8 11
3 6 9 12
julia> OffsetArrays.IdOffsetRange(3:4) == 3:4
true
julia> view(a, :, OffsetArrays.IdOffsetRange(3:4))
3×2 view(reshape(::UnitRange{Int64}, 3, 4), :, 3:4) with eltype Int64 with indices Base.OneTo(3)×OffsetArrays.IdOffsetRange(3:4):
13 16
14 17
15 18
julia> view(a, :, OffsetArrays.IdOffsetRange(3:4)) == view(a, :, 3:4)
false
Clearly the view is constructed incorrectly when an IdOffsetRange is used.
This is the same issue as
OffsetArrays#186, but I believe the fix should go intoBase. We use the axis typeIdOffsetRangedefined inOffsetArraysto construct the view.Clearly the view is constructed incorrectly when an
IdOffsetRangeis used.