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-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY 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 EDC4D1F5AE for ; Tue, 28 Jul 2020 18:43:02 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6BDA2120A1E; Wed, 29 Jul 2020 03:42:31 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 129951209E2 for ; Wed, 29 Jul 2020 03:42:28 +0900 (JST) Received: by filterdrecv-p3las1-7754f7d4cc-42stp with SMTP id filterdrecv-p3las1-7754f7d4cc-42stp-19-5F2071B0-1E 2020-07-28 18:42:56.234607089 +0000 UTC m=+2852958.316291919 Received: from herokuapp.com (unknown) by ismtpd0010p1iad1.sendgrid.net (SG) with ESMTP id HB6tWxn2T9aP5mjsVrpHNA for ; Tue, 28 Jul 2020 18:42:56.075 +0000 (UTC) Date: Tue, 28 Jul 2020 18:42:56 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75165 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 12671 X-Redmine-Issue-Author: headius X-Redmine-Sender: Eregon 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?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr0EvFcfBJ8rctIcMqUfRV?= =?us-ascii?Q?kA6JyTjdPdYAUchD+T2KCizzKaEI+hyL+gPKwji?= =?us-ascii?Q?PWHoVgQ4Aila+tKrcsybqQ67dP7=2FK6pIK3eGTM1?= =?us-ascii?Q?B5Ra0OKlsOjZQImKmx+GQPsSxx1S4pYjvYLCZh7?= =?us-ascii?Q?7=2FrM+gCvoQT1fJPwwDs4cfLpTcipd+xg=2FVQqtY2?= =?us-ascii?Q?UXUYB6XfOSrEG1ZHU=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99369 Subject: [ruby-core:99369] [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 Eregon (Benoit Daloze). Proposed fix (simple as it gets): https://github.com/ruby/ruby/pull/3370 ---------------------------------------- Bug #12671: Hash#to_proc result is not a lambda, but enforces arity https://bugs.ruby-lang.org/issues/12671#change-86772 * 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/