Skip to content

Commit

Permalink
missing eltype
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Dec 4, 2021
1 parent 6604021 commit c6aeed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,7 @@ function _vstack_plus(itr)
len = length(val)
n = haslength(itr) ? len*length(itr) : nothing

v = similar(val isa Tuple ? (1:0) : val, something(n, len))
v = similar(val isa Tuple ? (1:0) : val, eltype(val), something(n, len))
copyto!(v, 1, val, firstindex(val), len)

w = _stack_rest!(v, 0, n, axe, itr, state)
Expand Down
1 change: 1 addition & 0 deletions test/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,7 @@ end
@test stack([(1,2), (3,4)]) == [1 3; 2 4]
@test stack(((1,2), (3,4))) == [1 3; 2 4]
@test size(stack(Iterators.product(1:3, 1:4))) == (2,3,4)
@test stack([('a', 'b'), ('c', 'd')]) == ['a' 'c'; 'b' 'd']

# Mismatched sizes
@test_throws DimensionMismatch stack([1:2, 1:3])
Expand Down

0 comments on commit c6aeed6

Please sign in to comment.