Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodError prints "anonymous function" for anonymous functions #57340

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Bumblebee00
Copy link

If a MethodError arises on a anonyomous function, the words "anonymous function" are printed in the error like so:

g=(x,y)->x+y
g(1,2,3)
ERROR: MethodError: no method of the anonymous function var"#5#6" matching (::var"#5#6")(::Int64, ::Int64, ::Int64)
The function `#5` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  (::var"#5#6")(::Any, ::Any)
   @ Main REPL[4]:1

See the original pull request and issue #56325

@nsajko nsajko added the error messages Better, more actionable error messages label Feb 10, 2025
base/errorshow.jl Outdated Show resolved Hide resolved
Copy link
Member

@ararslan ararslan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Better, more actionable error messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants