diff options
author | Jeremy Evans <[email protected]> | 2024-01-14 11:41:02 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-14 11:41:02 -0800 |
commit | 5c823aa686a5549649df4af86d173bebed2418e1 (patch) | |
tree | 7044e21e631b6cb1557ef9aa42ac9b9b4d850898 /compile.c | |
parent | 772413245f782f538413a69a270ec75ee8b77f18 (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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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, |