From dd044f24223fab3280c86a9a9c96c53f88adb115 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Sat, 24 Feb 2024 20:26:49 -0500 Subject: [PATCH] clarify keyword arg method error message (#53460) This is a nice explanatory message, so I think we should make the wording less obscure. --- base/errorshow.jl | 2 +- test/errorshow.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/errorshow.jl b/base/errorshow.jl index 0705c142157d23..cc7659aa2d8ec4 100644 --- a/base/errorshow.jl +++ b/base/errorshow.jl @@ -359,7 +359,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() diff --git a/test/errorshow.jl b/test/errorshow.jl index 932122682983ef..2b497ed3f5f1b2 100644 --- a/test/errorshow.jl +++ b/test/errorshow.jl @@ -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