summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2024-01-14 11:41:02 -0800
committerGitHub <[email protected]>2024-01-14 11:41:02 -0800
commit5c823aa686a5549649df4af86d173bebed2418e1 (patch)
tree7044e21e631b6cb1557ef9aa42ac9b9b4d850898 /compile.c
parent772413245f782f538413a69a270ec75ee8b77f18 (diff)
Support keyword splatting nil
nil is treated similarly to the empty hash in this case, passing no keywords and not calling any conversion methods. Fixes [Bug #20064] Co-authored-by: Nobuyoshi Nakada <[email protected]>
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 6e0456af35..2d7e81d54e 100644
--- a/compile.c
+++ b/compile.c
@@ -5079,6 +5079,7 @@ compile_hash(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int meth
int last_kw = !RNODE_LIST(RNODE_LIST(node)->nd_next)->nd_next; /* foo( ..., **kw) */
int only_kw = last_kw && first_kw; /* foo(1,2,3, **kw) */
+ empty_kw = empty_kw || nd_type_p(kw, NODE_NIL); /* foo( ..., **nil, ...) */
if (empty_kw) {
if (only_kw && method_call_keywords) {
/* **{} appears at the only keyword argument in method call,