This isn’t really about the use of an abstract type; it’s just following the rules for all functions and methods in Julia (see Methods · The Julia Language ).
You need to somehow indicate that the greeting function you’re calling in Dummy is the same function you’re defining outside of it. The fact that they happen to have the same name is not enough.
In this case, you can declare the function inside Dummy and implement a new method for it outside:
module Dummy
function greeting
end
...
end
using .Dummy
...
Dummy.greeting(p::RealPerson, msg) = ...
If you don’t want to write out Dummy.greeting(, you can do:
import .Dummy: greeting
greeting(p::RealPerson, msg) = ...