Skip to content

Commit

Permalink
Fixes jruby#7918. Error with single splat method with keyword arguments
Browse files Browse the repository at this point in the history
Problem was that we were seeing an empty kwarg marked from
ruby2_keyword_hash and omitting it because it was a kwarg.  The
logic doing this was for a failing test in MRI test suite that
was passing that empty kwarg using a splat.  The fix was to
only pass this along if it is a non-splat caller.
  • Loading branch information
enebo committed Sep 8, 2023
1 parent 7df566a commit 19799e3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ public static IRubyObject receiveKeywords(ThreadContext context, IRubyObject[] a

args[args.length - 1] = hash;
return UNDEFINED;
} else if (ruby2_keywords_hash && hash.isEmpty()) {
} else if ((callInfo & CALL_SPLATS) != 0 && ruby2_keywords_hash && hash.isEmpty()) {
// case where we somehow (hash.clear) a marked ruby2_keyword. We pass it as keyword even in non-keyword
// accepting methods so it is subtracted from the arity count. Normally empty keyword arguments are not
// passed along but ruby2_keyword is a strange case since it is mutable by users.
Expand Down

0 comments on commit 19799e3

Please sign in to comment.