The function below is a minimal example of a bug I have seen a couple of times:
function update!(x) dx =  # Compute change x += dx # Update x (developer intended to write x .+= dx) # Any tests here show that x is correct. return dx end x = ; update!(x) # Any tests here show that x is incorrect.
What happens is that the local binding of
x is implicitly changed at the line
x += dx. It would be nice if julia required one to make this rebinding explicit, as in
local x += dx, but interestingly this gives:
ERROR: syntax: local variable name "x" conflicts with an argument
That is, Julia allows implicit rebinding of function arguments, but not explicit rebinding? To me, explicit rebinding should be mandatory to simplify debugging.