diff --git a/src/mapreduce.jl b/src/mapreduce.jl index b27a62ff..7732b08f 100644 --- a/src/mapreduce.jl +++ b/src/mapreduce.jl @@ -309,6 +309,8 @@ _valof(::Val{D}) where D = D (init = (similar_type(a, Union{}, Size(0))(), init),), ) do (ys, acc), x y = rf(acc, x) + # Not using `push(ys, y)` here since we need to widen element type as + # we iterate. (vcat(ys, SA[y]), y) end dims === (:) && return first(results)