I’m relatively new to Julia. Here’s a thing that puzzles me. If you have a simple overloaded function like this:
function a( x :: Float64 ) print( "Float version" ) end function a( x :: Integer ) print( "Integer version" ) end
it works exactly as you’d expect. But if you have named parameters, and the name is the same but the types differ, as in:
function b( ; x :: Float64 ) print( "Float version" ) end function b( ; x :: Integer ) print( "Integer version" ) end
Only the last declared function works; so calling
b here with an integer works
as I’d expect, but with a float type you get:
b(x=10.0) ERROR: TypeError: in #B, in typeassert, expected Integer, got Float64
Is this a bug, or deliberate?
Tested with Julia 1.03.