Skip to content

Commit 7232a9a

Browse files
authored
fix dispatch loop introduced by #19305 (#19357)
1 parent 0837ba4 commit 7232a9a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

base/abstractarray.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,10 +1293,10 @@ julia> hvcat((2,2,2), a,b,c,d,e,f)
12931293
If the first argument is a single integer `n`, then all block rows are assumed to have `n`
12941294
block columns.
12951295
"""
1296-
hvcat(rows::Tuple{Vararg{Int}}, xs::AbstractMatrix...) = typed_hvcat(promote_eltype(xs...), rows, xs...)
1297-
hvcat{T}(rows::Tuple{Vararg{Int}}, xs::AbstractMatrix{T}...) = typed_hvcat(T, rows, xs...)
1296+
hvcat(rows::Tuple{Vararg{Int}}, xs::AbstractVecOrMat...) = typed_hvcat(promote_eltype(xs...), rows, xs...)
1297+
hvcat{T}(rows::Tuple{Vararg{Int}}, xs::AbstractVecOrMat{T}...) = typed_hvcat(T, rows, xs...)
12981298

1299-
function typed_hvcat{T}(::Type{T}, rows::Tuple{Vararg{Int}}, as::AbstractMatrix...)
1299+
function typed_hvcat{T}(::Type{T}, rows::Tuple{Vararg{Int}}, as::AbstractVecOrMat...)
13001300
nbr = length(rows) # number of block rows
13011301

13021302
nc = 0

test/abstractarray.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,3 +785,6 @@ end
785785
@test ndims((1:3)[:,:,1:1,:]) == 4
786786
@test ndims((1:3)[:,:,1:1]) == 3
787787
@test ndims((1:3)[:,:,1:1,:,:,[1]]) == 6
788+
789+
# dispatch loop introduced in #19305
790+
@test [(1:2) zeros(2,2); ones(3,3)] == [[1,2] zeros(2,2); ones(3,3)] == [reshape([1,2],2,1) zeros(2,2); ones(3,3)]

0 commit comments

Comments
 (0)