From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 2B4471F461 for ; Mon, 2 Sep 2019 15:28:52 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7BB2A120B68; Tue, 3 Sep 2019 00:28:44 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id C27EC120B63 for ; Tue, 3 Sep 2019 00:28:42 +0900 (JST) Received: by filter0003p3iad2.sendgrid.net with SMTP id filter0003p3iad2-3612-5D6D352A-42 2019-09-02 15:28:42.86591965 +0000 UTC m=+504266.882784048 Received: from herokuapp.com (unknown [54.242.66.142]) by ismtpd0012p1iad1.sendgrid.net (SG) with ESMTP id XR62QfBZTqefbVLvPge3bg for ; Mon, 02 Sep 2019 15:28:42.829 +0000 (UTC) Date: Mon, 02 Sep 2019 15:28:43 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70300 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11860 X-Redmine-Issue-Author: sawa X-Redmine-Sender: jeremyevans0 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BIQRs6eppSydSH29wsFSJSygDQl5JCE36t8D6+g?= =?us-ascii?Q?rSNvBpRSFqeEkxy=2FmyzhpawVJIREpZsaBm5YDdL?= =?us-ascii?Q?8QGt=2FzmXv8mv2EYXMlF7GRWU79cJ3orXJGOnk90?= =?us-ascii?Q?q2keCfvbzmm+Y3oPISy77sjNey0x07v6sOw=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 94746 Subject: [ruby-core:94746] [Ruby master Bug#11860] Double splat does not work on empty hash assigned via variable X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11860 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Closed With recent commits to the master branch, keyword splats of empty hashes do not pass positional arguments to methods or cause an empty hash to be added to an array. ---------------------------------------- Bug #11860: Double splat does not work on empty hash assigned via variable https://bugs.ruby-lang.org/issues/11860#change-81363 * Author: sawa (Tsuyoshi Sawada) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: 2.3.0preview2 (2015-12-11 trunk 53028) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- When an empty hash is given as a literal, the double splat operates on it, and leaves nothing, which is expected. ```ruby class String def foo; end end [**{}] # => [] "foo".foo(**{}) # => nil "foo".send("foo", **{}) # => nil ``` However, when an empty hash is given via variable, the double splat retains an empty hash in place. ```ruby h = {} [**h] # => [{}] "foo".foo(**h) # => wrong number of arguments (given 1, expected 0) "foo".send("foo", **h) # => wrong number of arguments (given 1, expected 0) ``` -- https://bugs.ruby-lang.org/