Function conflict with different signatures

Probably the answer is “no”, but some boilerplate can help structuring the code. One way to achieve that could be something like:

julia> module CommonFunctions
           function f end
       end
Main.CommonFunctions

julia> module A
           import ..CommonFunctions: f
           f(x::Int) = 1
       end
Main.A

julia> module B
           import ..CommonFunctions: f
           f(x::Float64) = 1.0
       end
Main.B

At least it is clear that each module extends the functionality of the shared function.

2 Likes