Skip to content

Commit

Permalink
restore kwcall_mt optimizations (#48672)
Browse files Browse the repository at this point in the history
Deleted in cbfdb3f, probably by
accident. Refs #48670.
  • Loading branch information
vtjnash committed Feb 14, 2023
1 parent 6976bac commit afeda9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions test/keywordargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit afeda9f

Please sign in to comment.