Skip to content

Commit

Permalink
Fix reduce(vcat,...) type inference (JuliaLang#40277)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty authored Apr 1, 2021
1 parent 13caa8a commit fd77ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ AbstractVecOrTuple{T} = Union{AbstractVector{<:T}, Tuple{Vararg{T}}}

_typed_vcat_similar(V, ::Type{T}, n) where T = similar(V[1], T, n)
_typed_vcat(::Type{T}, V::AbstractVecOrTuple{AbstractVector}) where T =
_typed_vcat!(_typed_vcat_similar(V, T, mapreduce(length, +, V)), V)
_typed_vcat!(_typed_vcat_similar(V, T, sum(map(length, V))), V)

function _typed_vcat!(a::AbstractVector{T}, V::AbstractVecOrTuple{AbstractVector}) where T
pos = 1
Expand Down

0 comments on commit fd77ae6

Please sign in to comment.