Skip to content

Commit

Permalink
fix cat on empty arrays (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz authored Aug 17, 2024
1 parent 75767d4 commit 6aa28e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/array/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ function _check_cat_lookups(D, ::Irregular, lookups...)
end

function _check_cat_lookup_order(D, lookups::Lookup...)
length(lookups) > 1 || return true
l1 = first(lookups)
length(l1) == 0 && return _check_cat_lookup_order(D, Base.tail(lookups)...)
L = basetypeof(l1)
Expand Down
7 changes: 7 additions & 0 deletions test/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,13 @@ end
@test c == b
@test dims(c) == dims(b)
end

@testset "empty DimArrays" begin
empty = rand(X(Int64[]))
@test cat(empty, empty, dims=X) == empty
empty = rand(X(Int64[]), Y(Int64[]))
@test cat(empty, empty, dims=X) == empty
end
end

@testset "vcat" begin
Expand Down

0 comments on commit 6aa28e4

Please sign in to comment.