Is sum function broken?

I’m guessing you used sum as the name of a variable earlier in your script.

julia> sum = 1 + 2
3

julia> sum([1, 2])
ERROR: MethodError: objects of type Int64 are not callable
Stacktrace:
 [1] top-level scope at REPL[6]:1

julia> Base.sum([1, 2])
3
8 Likes