This topic is too deep in language for my, to understand what is really going on, so maybe I wrongly think that is a problem.
When you using
@which sum([1 2 3])
you get line
sum(a::AbstractArray) in Base at reducedim.jl:645. This is great feature, especially when you use Jupyter, but this line is (probably) wrong. reducedim.jl:645 is inside
for loop below
any!(r, A) function and function
sum(a::AbstractArray) is absent from this file. Function
sum(A::AbstractArray; dims) is at the line 370 of this file.