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=-4.1 required=3.0 tests=BAYES_00,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 7DBDA1F619 for ; Mon, 16 Mar 2020 13:45:54 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 818301209ED; Mon, 16 Mar 2020 22:45:27 +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 C7DD31209A0 for ; Mon, 16 Mar 2020 22:45:24 +0900 (JST) Received: by filterdrecv-p3las1-7d96d95698-b68ln with SMTP id filterdrecv-p3las1-7d96d95698-b68ln-20-5E6F8304-20 2020-03-16 13:45:40.185932835 +0000 UTC m=+392781.190051947 Received: from herokuapp.com (unknown [34.203.204.93]) by ismtpd0074p1mdw1.sendgrid.net (SG) with ESMTP id WHyUVxwgTwWC9rhwI1WaVQ for ; Mon, 16 Mar 2020 13:45:40.011 +0000 (UTC) Date: Mon, 16 Mar 2020 13:45:40 +0000 (UTC) From: mame@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 73257 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 12671 X-Redmine-Issue-Author: headius X-Redmine-Sender: mame 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?EJh2gqwnyqXtd++xo=2FinyA1V0bXouTB4FkWnzNiKb4=2FZ3Zqvrvk4M95e4CLdhR?= =?us-ascii?Q?37H8JBM7tQF37tDBV2pLvhikIAbdsGlbNgeKUEo?= =?us-ascii?Q?z7BiQDXB1pvWYZ=2FKxBF5mkt0DJEuYCl2U1+Bidm?= =?us-ascii?Q?dZPqKI05oWY1No=2FyRI+IRHsQGc1oNlAHIjwzJiH?= =?us-ascii?Q?64ywDheXMmDAL1Lu36DqKTJs9wnEm7mjMIiv9Qf?= =?us-ascii?Q?gUgXbodUpFG67XAG8=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 97527 Subject: [ruby-core:97527] [Ruby master Bug#12671] Hash#to_proc result is not a lambda, but enforces arity 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 #12671 has been updated by mame (Yusuke Endoh). This ticket was briefly discussed at today's dev meeting, and matz said that the result of Hash#to_proc should be a lambda. ---------------------------------------- Bug #12671: Hash#to_proc result is not a lambda, but enforces arity https://bugs.ruby-lang.org/issues/12671#change-84683 * Author: headius (Charles Nutter) * Status: Open * Priority: Normal * ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- ``` $ ruby23 -e 'pr = {foo:1}.to_proc; puts pr.lambda?; pr.call rescue puts $!; pr.call(1, 2) rescue puts $!' false wrong number of arguments (given 0, expected 1) wrong number of arguments (given 2, expected 1) ``` I believe it should be marked as a lambda, since it enforces arity. -- https://bugs.ruby-lang.org/