I don’t think so. In my example,
function fn_generator()
if true
f() = 0
else
f(x, y) = x+y
end
end
both method definitions are returned:
julia> fn_generator()
(::var"#f#1") (generic function with 2 methods)
However, if instead I say
function fn_generator2()
if false
f(x, y) = x+y
else
f() = 0
end
end
then I get an error:
julia> fn_generator2()
ERROR: UndefVarError: f not defined
Is that intended?