Int32
method add_
instead of add
. When I then called add
with arguments of type Int32
, they were converted to Float64
and the Float64
overload was called. But removing the spurious _
fixes the problem, creating separate overloads, which are separately called by add(1, 2)
and add(0.1, 0.2)
. The output of each program is the same, which is why it I didn't notice the mistake at first.