Skip to content

Commit

Permalink
clarify keyword arg method error message (JuliaLang#53460)
Browse files Browse the repository at this point in the history
This is a nice explanatory message, so I think we should make the
wording less obscure.
  • Loading branch information
JeffBezanson authored Feb 25, 2024
1 parent 138aba7 commit 714c6d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ function showerror(io::IO, ex::MethodError)
if ex.world == typemax(UInt) || isempty(kwargs)
print(io, "\nThis error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented.")
else
print(io, "\nThis method may not support any kwargs.")
print(io, "\nThis method may not support any keyword arguments.")
end
elseif hasmethod(f, arg_types) && !hasmethod(f, arg_types, world=ex.world)
curworld = get_world_counter()
Expand Down
2 changes: 1 addition & 1 deletion test/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ end

str = sprint(Base.showerror, MethodError(Core.kwcall, ((; a=3.0), +, 1.0, 2.0), Base.get_world_counter()))
@test startswith(str, "MethodError: no method matching +(::Float64, ::Float64; a::Float64)")
@test occursin("This method may not support any kwargs", str)
@test occursin("This method may not support any keyword arguments", str)

@test_throws "MethodError: no method matching kwcall()" Core.kwcall()
end
Expand Down

0 comments on commit 714c6d0

Please sign in to comment.