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

fix keyword values being shown in MethodError #45255

Merged
merged 1 commit into from
May 12, 2022

Conversation

KristofferC
Copy link
Member

Fixes #45219

@@ -272,8 +272,7 @@ function showerror(io::IO, ex::MethodError)
if !isempty(kwargs)
print(io, "; ")
for (i, (k, v)) in enumerate(kwargs)
print(io, k, "=")
show(IOContext(io, :limit => true), v)
print(io, k, "::", typeof(v))
Copy link
Member

Choose a reason for hiding this comment

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

Should this be 'showarg'?

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't this look strange?

ERROR: MethodError: no method matching f(::Float64; v::view(::Matrix{Float64}, :, :) with eltype Float64)
Closest candidates are:
  f(::Int64; v) at REPL[5]:1

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't that be "v=" not "v::"?

Copy link
Member Author

Choose a reason for hiding this comment

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

So f(::Float64; v=view(::Matrix{Float64}, :, :) with eltype Float64). That doesn't look right?

@KristofferC KristofferC merged commit 3653d3d into master May 12, 2022
@KristofferC KristofferC deleted the kc/methoderr_kw_value branch May 12, 2022 05:58
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.

Avoid printing values of keyword arguments while displaying a MethodError
2 participants