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 (smtp.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id D18E11A00018 for ; Mon, 15 Feb 2016 01:13:35 +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 C3EB2B5D8BC for ; Mon, 15 Feb 2016 01:48:25 +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 9D34C18CC7B9 for ; Mon, 15 Feb 2016 01:48:25 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4706712043B; Mon, 15 Feb 2016 01:48:25 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 568951203F8 for ; Mon, 15 Feb 2016 01:48:21 +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=bWqtPRoqUcgeswBoSs/+lNApQCA=; b=hMYcn7jgEgec1/1uB3 k8J9LQcLXepNNMCIzxn1RgXL0tHEB+q17ccrje6LgLBc5NdgL3sJb7s/a9quvhQP jqVWcmvJjrdr3rdA3DZMW2X9NQNJG6IeVR9vCUsf1JiOPnjcQPtCHAupkfrO9Rlp vEKqTrzfqrDXjA0SvVHZ+uEHg= Received: by filter0440p1mdw1.sendgrid.net with SMTP id filter0440p1mdw1.6449.56C0AFD03F 2016-02-14 16:48:16.649307171 +0000 UTC Received: from herokuapp.com (ec2-174-129-143-34.compute-1.amazonaws.com [174.129.143.34]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id NN9ynVmMQGGetjhMoN34PQ for ; Sun, 14 Feb 2016 16:48:16.365 +0000 (UTC) Date: Sun, 14 Feb 2016 16:48:16 +0000 From: justcolin@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 48412 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11860 X-Redmine-Issue-Author: sawa X-Redmine-Sender: justcolin 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6tUpOFhG8BXEpksXCcpBJtrQu5OPzURqPTOK h1xdc4F+26BtF5oHu2Ntc7GZ3QPt8UyzSfmzLPL3loaghNK03saB3vJQOl1RKttfofojR9OQneDVsv /Nhrz2sA4sVTF2gYs6juJdMNRyOVqey8oaKlXWXrJPy5ackJOjGIQINdbQ== X-ML-Name: ruby-core X-Mail-Count: 73811 Subject: [ruby-core:73811] [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: , 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 Colin Fulton. A similar bug happens when using the double splat operator in the parameter list of a method definition. See #12022. ---------------------------------------- Bug #11860: Double splat does not work on empty hash assigned via variable https://bugs.ruby-lang.org/issues/11860#change-56989 * 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/