ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:81918] [Ruby trunk Bug#10856] Splat with empty keyword args gives unexpected results
Date: Wed, 05 Jul 2017 15:21:25 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-65647.20170705152123.fd7cb8e6901b042a@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10856.20150215204702@ruby-lang.org

Issue #10856 has been updated by nobu (Nobuyoshi Nakada).

Description updated

https://github.com/ruby/ruby/compare/trunk...nobu:bug/10856-splat-hash

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

* Author: seantheprogrammer (Sean Griffin)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* 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/

  parent reply	other threads:[~2017-07-05 15:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-10856.20150215204702@ruby-lang.org>
2015-02-15 20:47 ` [ruby-core:68124] [Ruby trunk - Bug #10856] [Open] Splat with empty keyword args gives unexpected results sean
2015-02-17  5:40 ` [ruby-core:68135] [Ruby trunk - Bug #10856] [Closed] " shugo
2015-03-05 15:31 ` [ruby-core:68429] [Ruby trunk - Bug #10856] " sean
2015-05-11  7:20 ` [ruby-core:69120] [Ruby trunk - Bug #10856] [Open] " nobu
2015-05-14  7:28 ` [ruby-core:69187] [Ruby trunk - Bug #10856] " matz
2015-08-10 12:27 ` [ruby-core:70299] " i
2015-08-10 14:33 ` [ruby-core:70302] " ruby-core
2016-08-21  6:09 ` [ruby-core:76995] [Ruby trunk Bug#10856] " guyren
2016-08-21 15:29 ` [ruby-core:76996] " eregontp
2017-07-05 15:21 ` nobu [this message]
2017-11-01 17:02 ` [ruby-core:83638] [Ruby trunk Bug#10856][Open] " ruby-core
2019-03-14  5:06 ` [ruby-core:91825] [Ruby trunk Bug#10856] " mame
2019-03-14  8:45 ` [ruby-core:91829] " mame

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-65647.20170705152123.fd7cb8e6901b042a@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).