Skip to content

Commit 23b4400

Browse files
author
Pietro Vertechi
authored
respect array type (JuliaArrays#32)
1 parent eac2650 commit 23b4400

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/collect.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ widenfieldarrays(dest::AbstractArray, i, el) = widenarray(dest, i, el)
107107

108108
function widenarray(dest::AbstractArray{T}, i, el::S) where {S, T}
109109
S <: T && return dest
110-
new = Array{promote_type(S, T)}(undef, length(dest))
110+
new = similar(dest, promote_type(S, T), length(dest))
111111
copyto!(new, 1, dest, 1, i-1)
112112
new
113113
end

0 commit comments

Comments
 (0)