Note that
julia> sum(Int[]) 0
I.e. it works when it is able to determine the type of the empty array.