From 9f392b317aaac895680972c53504622feb46fbdd Mon Sep 17 00:00:00 2001 From: Jonnie Diegelman Date: Sat, 11 May 2024 09:11:20 -0400 Subject: [PATCH] Fix multi-symbol indexing when components are matrices --- src/axis.jl | 2 +- test/runtests.jl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/axis.jl b/src/axis.jl index b392796..317b3a5 100644 --- a/src/axis.jl +++ b/src/axis.jl @@ -173,7 +173,7 @@ function Base.getindex(ax::AbstractAxis, syms::Union{NTuple{N,Symbol}, <:Abstrac return ComponentIndex(vcat(inds...), new_ax) end -_maybe_view_axis(inds, ax::Axis) = ViewAxis(inds, ax) +_maybe_view_axis(inds, ax::AbstractAxis) = ViewAxis(inds, ax) _maybe_view_axis(inds, ::NullAxis) = inds[1] struct CombinedAxis{C,A} <: AbstractUnitRange{Int} diff --git a/test/runtests.jl b/test/runtests.jl index 3e7b54e..da0acf1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -286,7 +286,10 @@ end # We had to revert this because there is no way to work around # OffsetArrays' type piracy without introducing type piracy # ourselves because `() isa Tuple{N, <:CombinedAxis} where {N}` - # @test reshape(a, axes(ca)...) isa Vector{Float64} + @test_broken reshape(a, axes(ca)...) isa Vector{Float64} + + # Issue #265: Multi-symbol indexing with matrix components + @test ca2.c[[:a, :b]].b isa AbstractMatrix end @testset "Set" begin