From 47baf274c3a924f8703551088423a469d60716ce Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 14 Feb 2023 10:40:19 -0500 Subject: [PATCH] restore kwcall_mt optimizations Deleted in cbfdb3facd0f2ece4088f43ef97533e9e0921081, probably by accident. Refs #48670. --- src/staticdata.c | 3 ++- test/keywordargs.jl | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/staticdata.c b/src/staticdata.c index 8f11d90b155f3..51ef3d50f767f 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -98,7 +98,7 @@ extern "C" { // TODO: put WeakRefs on the weak_refs list during deserialization // TODO: handle finalizers -#define NUM_TAGS 158 +#define NUM_TAGS 159 // An array of references that need to be restored from the sysimg // This is a manually constructed dual of the gvars array, which would be produced by codegen for Julia code, for C. @@ -241,6 +241,7 @@ jl_value_t **const*const get_tags(void) { INSERT_TAG(jl_typeinf_func); INSERT_TAG(jl_type_type_mt); INSERT_TAG(jl_nonfunction_mt); + INSERT_TAG(jl_kwcall_mt); INSERT_TAG(jl_kwcall_func); // some Core.Builtin Functions that we want to be able to reference: diff --git a/test/keywordargs.jl b/test/keywordargs.jl index a5116afa3c31d..7211cfa85701d 100644 --- a/test/keywordargs.jl +++ b/test/keywordargs.jl @@ -387,3 +387,10 @@ f41416(a...="a"; b=true) = (b, a) @test f41416(;b=false) === (false, ("a",)) @test f41416(33) === (true, (33,)) @test f41416(3; b=false) === (false, (3,)) + +Core.kwcall(i::Int) = "hi $i" +let m = first(methods(Core.kwcall, (Any,typeof(kwf1),Vararg))) + @test m.name === :kwf1 + @test Core.kwcall(1) == "hi 1" + @test which(Core.kwcall, (Int,)).name === :kwcall +end