mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Allow foo(**nil, &block_arg)
Previously, `**nil` by itself worked, but if you add a block argument, it raised a conversion error. The presence of the block argument shouldn't change how keyword splat works. See: <https://bugs.ruby-lang.org/issues/20064>
This commit is contained in:
parent
e08c128417
commit
e878bbd641
3 changed files with 19 additions and 4 deletions
|
@ -563,7 +563,12 @@ splatkw
|
|||
(VALUE obj, VALUE block)
|
||||
// attr bool leaf = false; /* has rb_to_hash_type() */
|
||||
{
|
||||
obj = rb_to_hash_type(hash);
|
||||
if (NIL_P(hash)) {
|
||||
obj = Qnil;
|
||||
}
|
||||
else {
|
||||
obj = rb_to_hash_type(hash);
|
||||
}
|
||||
}
|
||||
|
||||
/* put new Hash from n elements. n must be an even number. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue