Skip to content

non-scalar indexing is broken for ArrayPartition #49

@kolia

Description

@kolia
using RecursiveArrayTools
a = ArrayPartition(1:5, 1:6)

a[1:8]
a[[1,3,8]]

both throw

ERROR: DimensionMismatch("output array is the wrong size; expected (Base.OneTo(8),), got (11,)")
Stacktrace:
 [1] throw_checksize_error(::ArrayPartition{Int64,Tuple{Array{Int64,1},Array{Int64,1}}}, ::Tuple{Base.OneTo{Int64}}) at ./multidimensional.jl:625
 [2] _unsafe_getindex(::IndexCartesian, ::ArrayPartition{Int64,Tuple{UnitRange{Int64},UnitRange{Int64}}}, ::UnitRange{Int64}) at ./multidimensional.jl:602
 [3] _getindex at ./multidimensional.jl:589 [inlined]
 [4] getindex(::ArrayPartition{Int64,Tuple{UnitRange{Int64},UnitRange{Int64}}}, ::UnitRange{Int64}) at ./abstractarray.jl:905

Single-indexing a[3] works just fine, obviously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions