Skip to content

Commit cab9462

Browse files
authored
Fix #277 (#278)
* Fix #277 * Patch bump
1 parent eb20954 commit cab9462

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterface"
22
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
3-
version = "6.0.2"
3+
version = "6.0.3"
44

55
[deps]
66
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"

lib/ArrayInterfaceOffsetArrays/test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ o = OffsetArray(vec(A), 8);
2626
@test @inferred(ArrayInterface.device(OffsetArray(@view(reshape(1:8, 2,2,2)[1,1:2,:]),-3,4))) === ArrayInterface.CPUIndex()
2727
@test @inferred(ArrayInterface.device(OffsetArray(zeros(2,2,2),8,-2,-5))) === ArrayInterface.CPUPointer()
2828

29+
offset_view = @view OffsetArrays.centered(zeros(eltype(A), 5, 5))[:, begin]; # SubArray of OffsetArray
30+
@test @inferred(ArrayInterface.known_offsets(out)) == (-2,)
31+

src/axes.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ end
4343
axes_types(::Type{T}) where {T<:ReshapedArray} = NTuple{ndims(T),OneTo{Int}}
4444
function _sub_axis_type(::Type{PA}, ::Type{I}, dim::StaticInt{D}) where {I<:Tuple,PA,D}
4545
IT = field_type(I, dim)
46-
if IT <: Base.Slice
46+
if IT <: Base.Slice{Base.OneTo{Int}}
47+
# this helps workaround slices over statically sized dimensions
4748
axes_types(field_type(PA, dim), static(1))
4849
else
4950
axes_types(IT, static(1))

0 commit comments

Comments
 (0)