Skip to content

Commit 7e8a720

Browse files
Merge branch 'master' into mbaran/fix-277
2 parents 343e709 + d9a3a7a commit 7e8a720

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/array_partition.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ function Base._unsafe_getindex(::IndexStyle, A::ArrayPartition,
264264
return dest
265265
end
266266

267+
Base._maybe_reshape(::IndexCartesian, A::ArrayPartition, I::Vararg{Union{Real, AbstractArray}, N}) where {N} = Vector(A)
268+
267269
"""
268270
setindex!(A::ArrayPartition, v, i::Int, j...)
269271

test/partitions_test.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,6 @@ end
244244
end
245245

246246
@test !iszero(ArrayPartition([2], [3, 4]))
247+
@testset "Cartesian indexing" begin
248+
@test ArrayPartition([1,2], [3])[1:3,1] == [1, 2, 3]
249+
end

0 commit comments

Comments
 (0)