julia icon indicating copy to clipboard operation
julia copied to clipboard

Add MethodError hints for functions in other modules

Open Keno opened this issue 4 months ago • 2 comments

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

Keno avatar Jun 12 '25 01:06 Keno