Here's what looks to me the simplest imaginable example of multiple dispatch in Julia - it's the entire (8 line) contents of a file called adhoc.jl.
f = function(x::String)
println("Called first version of f")
end
f = function(x::Float64)
println("Called second version of f")
end
f("x")
f(1.0)
and yet when I run that (via include("Adhoc.jl")) julia complains:
ERROR: LoadError: MethodError: no method matching
(::getfield(Main, Symbol("##17#18")))(::String)
With screenshot here
If I change that second instance of f to g things work, but that's no longer making use of multiple dispatch. How come I can't get to first base with multiple dispatch?