PUP-6952 for some background. If you want to use a 4.x style function declared in another module you have to make that module a dependency of your module.
If you don't declare the dependency then you get an error like this:
The error message should be more clear about why it couldn't find the function.
The compiler should check the declared dependency modules for a function and if it does not find it then expand the search to all modules in the modulepath so the error message can be more direct about what might need to happen.
The same error message could have something like the following added to it to make it more clear
"There is a type_of function in the stdlib module which is not declared as a dependency of this module. Please add stdlib as a dependency of this module if you intended to use type_of from stdlib."
Exact wording not recommended but you get the idea.
If you don't declare any dependencies for your module then you don't run into this as then the default behavior is to look through all modules.