Let’s say you have a module in a package called IO (obviously not preferable):
module IO
custom_input_output_stuff = true
end
The problem now is that the module IO will clobber the Base IO type in calls.
This leads to the following errors:
> foo(bar::IO) = "nope, chuck testa"
ERROR: ArgumentError: invalid type for argument bar in method definition for foo at REPL[10]:100:
> struct Fizz ; buzz::IO ; end
ERROR: TypeError: Fizz: in type definition, expected Type, got Module
How do you tell the package to use Base's IO when a type is expected?
No, currently there is no other way, but to use the fully-qualified name of a type.
e.g. Base.IO.
Namespacing issues like that are a problem, and one that deserves a better solution, but until there is one, either avoid reusing names like that or use fully qualified names.