The easiest way to explain the problem is with a code snippet.
function foo()
bar(x) = 1+x
println(bar(1)) #expecting a 2 here
bar(x) = -100000x
println(bar(1)) #expecting -100000
end
foo()
OUTPUT:
-100000
-100000
I imagine that the compiler is optimizing away a function that doesn't last long, but I haven't seen anything in the docs that would cause me to expect this behavior, and Google returns nothing but the docs. What is going on here?