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 4750319E0036 for ; Tue, 22 Dec 2015 17:01:43 +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 40FC5B5D953 for ; Tue, 22 Dec 2015 17:34:01 +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 D829D18CC7D0 for ; Tue, 22 Dec 2015 17:34:01 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8FE86120575; Tue, 22 Dec 2015 17:34:00 +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 59D631204C6 for ; Tue, 22 Dec 2015 17:33:57 +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=E6AmU3Sx1cAD3C58eYZ2OQsUTT8=; b=AW8mLPkLSrzhAxo2OC thEpTRSY/XReY11BgkDIDsYY9qLUtQnvKeO9nWbEGLzYd87mmUJ2zahdaweSn926 9R68nCULJ2YeYukpCxLRApb6PQsS+IvwbW7Q5fnoWRgCfpTcePJV7HecdHaqF3Da GLul3XEGa562sE+CUisfItWfU= Received: by filter0922p1mdw1.sendgrid.net with SMTP id filter0922p1mdw1.23195.56790AF236 2015-12-22 08:33:54.826163677 +0000 UTC Received: from herokuapp.com (ec2-54-205-142-226.compute-1.amazonaws.com [54.205.142.226]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id I8t4UDQhTA2U3FVq5ozlBA for ; Tue, 22 Dec 2015 08:33:54.808 +0000 (UTC) Date: Tue, 22 Dec 2015 08:33:54 +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: 47032 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4QytKZhz/w4GuveOdn39GVozl8PBOwngnsP3 75zKeWWKSAkER0OttxCxUid37gxVJ/i4nUd80WQvmZIjAImi4Cn73Ff6d3CPbpr04xKKbtbVQsP4bH xbbjvLYKKoUOjBWCs+ugyKKHIYNSli2i1iyb478mYyicQwrYrfvDPtzJRA== X-ML-Name: ruby-core X-Mail-Count: 72429 Subject: [ruby-core:72429] [Ruby trunk - Bug #11860] [Open] 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 reported by Tsuyoshi Sawada. ---------------------------------------- Bug #11860: Double splat does not work on empty hash assigned via variable https://bugs.ruby-lang.org/issues/11860 * 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/