@@ -1692,9 +1692,9 @@ cat_indices(A::AbstractArray, d) = axes(A, d)
16921692cat_similar (A, :: Type{T} , shape:: Tuple ) where T = Array {T} (undef, shape)
16931693cat_similar (A, :: Type{T} , shape:: Vector ) where T = Array {T} (undef, shape... )
16941694cat_similar (A:: Array , :: Type{T} , shape:: Tuple ) where T = Array {T} (undef, shape)
1695- cat_similar (A:: Array , :: Type{T} , shape:: Vector ) where T = Array {T} (undef, shape... )
1695+ cat_similar (A:: Array , :: Type{T} , shape:: Vector , :: Val{N} ) where {T, N} = Array {T, N } (undef, shape... )
16961696cat_similar (A:: AbstractArray , T:: Type , shape:: Tuple ) = similar (A, T, shape)
1697- cat_similar (A:: AbstractArray , T:: Type , shape:: Vector ) = similar (A, T, shape... )
1697+ cat_similar (A:: AbstractArray , T:: Type , shape:: Vector , :: Val{N} ) = similar (A, T, shape... )
16981698
16991699# These are for backwards compatibility (even though internal)
17001700cat_shape (dims, shape:: Tuple{Vararg{Int}} ) = shape
@@ -2445,7 +2445,7 @@ function _typed_hvncat_dims(::Type{T}, dims::NTuple{N, Int}, row_first::Bool, as
24452445 throw (ArgumentError (" mismatched number of elements; expected $(outlen) , got $(elementcount) " ))
24462446
24472447 # copy into final array
2448- A = cat_similar (as[1 ], T, outdims)
2448+ A = cat_similar (as[1 ], T, outdims, Val (N) )
24492449 # @assert all(==(0), currentdims)
24502450 outdims .= 0
24512451 hvncat_fill! (A, currentdims, outdims, d1, d2, as)
@@ -2539,7 +2539,7 @@ function _typed_hvncat_shape(::Type{T}, shape::NTuple{N, Tuple}, row_first, as::
25392539 # @assert all(==(0), blockcounts)
25402540
25412541 # copy into final array
2542- A = cat_similar (as[1 ], T, outdims)
2542+ A = cat_similar (as[1 ], T, outdims, Val ( length (outdims)) )
25432543 hvncat_fill! (A, currentdims, blockcounts, d1, d2, as)
25442544 return A
25452545end
0 commit comments