julia
julia copied to clipboard
Add MethodError hints for functions in other modules
When a MethodError occurs, check if functions with the same name exist in other modules (particularly those of the argument types). This helps users discover that they may need to import a function or ensure multiple functions are the same generic function.
- For Base functions: suggests importing (e.g., "You may have intended to import Base.length")
- For other modules: suggests they may be intended as the same generic function
- Shows all matches from relevant modules in sorted order
- Uses modulesof! to properly handle all type structures including unions
Fixes #58682