However, 
g(n) = sum( i^2 for i = 1:n )
julia> g(0)
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 mr_empty(::Base.#identity, ::Base.#+, ::Type{T}) at 
/Users/ortner/gits/julia/usr/lib/julia/sys.dylib:?
 in mapfoldl(::Base.#identity, ::Function, 
::Base.Generator{UnitRange{Int64},##3#4}) at ./reduce.jl:60
 in g(::Int64) at ./REPL[17]:1

though this seems to have been fixed with JuliaLang/julia#18873 ????   (I 
haven't tested it yet)

Reply via email to