[#92063] [Ruby trunk Misc#15723] Reconsider numbered parameters — zverok.offline@...
Issue #15723 has been updated by zverok (Victor Shepelev).
3 messages
2019/03/31
[ruby-core:91829] [Ruby trunk Bug#10856] Splat with empty keyword args gives unexpected results
From:
mame@...
Date:
2019-03-14 08:45:37 UTC
List:
ruby-core #91829
Issue #10856 has been updated by mame (Yusuke Endoh).
Another presentation of the bug:
```
def foo; end
foo(*[], {}) #=> does not raise an exception in 2.6
```
----------------------------------------
Bug #10856: Splat with empty keyword args gives unexpected results
https://bugs.ruby-lang.org/issues/10856#change-77099
* Author: seantheprogrammer (Sean Griffin)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version: 2.7
* 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:
```ruby
def foo
end
foo(**{})
```
This causes an argument error, as an empty hash is passed. I would expect the same behavior as
```ruby
def foo
end
foo(*[])
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>