Skip to content

Commit f5ffd96

Browse files
authored
Fix multi-symbol indexing when components are matrices (#259)
1 parent e7f766e commit f5ffd96

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/axis.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function Base.getindex(ax::AbstractAxis, syms::Union{NTuple{N,Symbol}, <:Abstrac
173173
return ComponentIndex(vcat(inds...), new_ax)
174174
end
175175

176-
_maybe_view_axis(inds, ax::Axis) = ViewAxis(inds, ax)
176+
_maybe_view_axis(inds, ax::AbstractAxis) = ViewAxis(inds, ax)
177177
_maybe_view_axis(inds, ::NullAxis) = inds[1]
178178

179179
struct CombinedAxis{C,A} <: AbstractUnitRange{Int}

test/runtests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ end
286286
# We had to revert this because there is no way to work around
287287
# OffsetArrays' type piracy without introducing type piracy
288288
# ourselves because `() isa Tuple{N, <:CombinedAxis} where {N}`
289-
# @test reshape(a, axes(ca)...) isa Vector{Float64}
289+
@test_broken reshape(a, axes(ca)...) isa Vector{Float64}
290+
291+
# Issue #265: Multi-symbol indexing with matrix components
292+
@test ca2.c[[:a, :b]].b isa AbstractMatrix
290293
end
291294

292295
@testset "Set" begin

0 commit comments

Comments
 (0)