```
sum(i for i in Vector{Int}())
```

raises an error:

ERROR: MethodError: no method matching zero(::Type{Any})

Closest candidates are:

zero(::Type{Base.LibGit2.Oid}) at libgit2/oid.jl:88

zero(::Type{Base.Pkg.Resolve.VersionWeights.VWPreBuildItem}) at pkg/resolve/versionweight.jl:80

zero(::Type{Base.Pkg.Resolve.VersionWeights.VWPreBuild}) at pkg/resolve/versionweight.jl:120

…

in mr_empty(::Base.#identity, ::Base.#+, ::Type{T}) at ./reduce.jl:130

in mapfoldl(::Base.#identity, ::Function, ::Base.Generator{Array{Int64,1},##11#12}) at ./reduce.jl:60

in sum(::Base.Generator{Array{Int64,1},##11#12}) at ./reduce.jl:229

Why can’t `sum`

infer that the type is `Int`

, and return an integer 0?

(The mathematical definition of an empty sum is 0)