Is sum function broken?

Recently installed version 1.5.3 and I get this error when trying sum function:
julia
Also tried with dot (’.’) and with dims as second argument, but nothing worked.
prod(A) would work for example
Does anyone have an idea what is this about?
Thanks in advance.

Can you restart your REPL? It sounds like you have re-defined sum somewhere.

2 Likes

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

@affans @stillyslalom Thanks, you are right. God I feel stupid now haha :smiley: