[ruby-core:68124] [Ruby trunk - Bug #10856] [Open] Splat with empty keyword args gives unexpected results

0 views
Skip to first unread message

se...@seantheprogrammer.com

unread,
Feb 15, 2015, 3:47:19 PM2/15/15
to ruby...@ruby-lang.org
Issue #10856 has been reported by Sean Griffin.

----------------------------------------
Bug #10856: Splat with empty keyword args gives unexpected results
https://bugs.ruby-lang.org/issues/10856

* Author: Sean Griffin
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
When keyword args are passed to a method with splat, and there are no keyword args, an empty hash is sent. I would expect no argument to be given, same as splat with an empty array. For example:

def foo
end

foo(**{})

This causes an argument error, as an empty hash is passed. I would expect the same behavior as

def foo
end

foo(*[])



--
https://bugs.ruby-lang.org/

sh...@ruby-lang.org

unread,
Feb 17, 2015, 12:41:01 AM2/17/15
to ruby...@ruby-lang.org
Issue #10856 has been updated by Shugo Maeda.

Status changed from Open to Closed

Sean Griffin wrote:
> When keyword args are passed to a method with splat, and there are no keyword args, an empty hash is sent. I would expect no argument to be given, same as splat with an empty array. For example:

It was fixed in r49193.


----------------------------------------
Bug #10856: Splat with empty keyword args gives unexpected results
https://bugs.ruby-lang.org/issues/10856#change-51522

* Author: Sean Griffin
* Status: Closed
Reply all
Reply to author
Forward
0 new messages