From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 893C419E0036 for ; Tue, 22 Dec 2015 17:03:34 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 84781B5D945 for ; Tue, 22 Dec 2015 17:35:52 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 04D4818CC7D1 for ; Tue, 22 Dec 2015 17:35:52 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id D3453120575; Tue, 22 Dec 2015 17:35:51 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 93A041204C6 for ; Tue, 22 Dec 2015 17:35:47 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=tfxcTExp2U60YF4+Xv7ihQ9MlFE=; b=zDViJZX57ssAiV6NHy r5GLIsKAoUP2lbSM8sZnPF58H3oOkWzGOBj+3alFU+YWzZ+v8GFDf3TZETDEjUsY I7AIB+YZM+NcKJ71K8VisrDeRfr3gi4+asFer943bkEMACdlmZT9Ypu8TuMra8iq kHh9KPHvJ4qYbwPKT02yAcfxI= Received: by filter0428p1mdw1.sendgrid.net with SMTP id filter0428p1mdw1.18304.56790B6011 2015-12-22 08:35:44.374199087 +0000 UTC Received: from herokuapp.com (ec2-54-197-147-200.compute-1.amazonaws.com [54.197.147.200]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id _FRDS2mPRVWKwKWPmROsBQ for ; Tue, 22 Dec 2015 08:35:44.288 +0000 (UTC) Date: Tue, 22 Dec 2015 08:35:44 +0000 From: sawadatsuyoshi@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 47033 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11860 X-Redmine-Issue-Author: sawa X-Redmine-Sender: sawa 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6zWnJUNMmsnPt0+qpRhMdUXKiLOE9gVznB2N sl9kq6vMZJLnydQtppL+Eb459bWFATi0mC2qzBdnzssyztN74N9VkE7N0g3IuZXYxMbb/KxREnBLu2 uX40S6bho1BY3XyVpSa1JxEiFMmtlYaocM43/RTZsMD2BmVVuicmAe8ZhQ== X-ML-Name: ruby-core X-Mail-Count: 72430 Subject: [ruby-core:72430] [Ruby trunk - 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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11860 has been updated by Tsuyoshi Sawada. Sorry, the `send` examples were wrong. They should be: "foo".send("foo", **{}) # => nil "foo".send("foo", **h) # => wrong number of arguments (given 1, expected 0) ---------------------------------------- Bug #11860: Double splat does not work on empty hash assigned via variable https://bugs.ruby-lang.org/issues/11860#change-55723 * Author: Tsuyoshi Sawada * Status: Open * Priority: Normal * Assignee: * 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. class String def foo; end end [**{}] # => [] "foo".foo(**{}) # => nil "foo".send(**{}) # => nil However, when an empty hash is given via variable, the double splat retains an empty hash in place. h = {} [**h] # => [{}] "foo".foo(**h) # => wrong number of arguments (given 1, expected 0) "foo".send(**h) # => wrong number of arguments (given 1, expected 0) -- https://bugs.ruby-lang.org/