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=-3.9 required=3.0 tests=AWL,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 EB8161F463 for ; Tue, 24 Dec 2019 07:06:33 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0CE00120B14; Tue, 24 Dec 2019 16:06:21 +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 EE139120B13 for ; Tue, 24 Dec 2019 16:06:18 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-cmkgv with SMTP id filterdrecv-p3mdw1-56c97568b5-cmkgv-18-5E01B8F1-12 2019-12-24 07:06:25.329602379 +0000 UTC m=+627798.924348962 Received: from herokuapp.com (unknown [54.226.93.224]) by ismtpd0071p1iad2.sendgrid.net (SG) with ESMTP id -hcqh4wpRcWG2GQcHsjqMQ for ; Tue, 24 Dec 2019 07:06:25.291 +0000 (UTC) Date: Tue, 24 Dec 2019 07:06:25 +0000 (UTC) From: mame@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72111 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16289 X-Redmine-Issue-Author: mame X-Redmine-Issue-Assignee: mame 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=2FwP5290TsAF6=2FFHd=2FII7?= =?us-ascii?Q?1g6zGwA2y1zskkp9eWooIPt5X0f8ARoHBigstzm?= =?us-ascii?Q?FvC6a4Y1yqhuG7V91spgP9CpGAhBU4hnJjkuBR1?= =?us-ascii?Q?GxPMY=2FdKwEOXLLf9gV=2FxfmuvtnIYsU2fxrwYHJ6?= =?us-ascii?Q?wnO+nWzbV6xncDafZOCSIY9QxhWi7307jOgYOIZ?= =?us-ascii?Q?YVt7QEu4hhuUzOntg=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96452 Subject: [ruby-core:96452] [Ruby master Feature#16289] Reduce duplicated warnings for the change of Ruby 3 keyword arguments 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 #16289 has been updated by mame (Yusuke Endoh). @marcandre You have to wait for matz and naruse's approvals! I'll ask them. ---------------------------------------- Feature #16289: Reduce duplicated warnings for the change of Ruby 3 keyword arguments https://bugs.ruby-lang.org/issues/16289#change-83377 * Author: mame (Yusuke Endoh) * Status: Closed * Priority: Normal * Assignee: mame (Yusuke Endoh) * Target version: ---------------------------------------- ## Problem Currently, the interpreter emits 200 lines of warnings against the following program. ```ruby def foo(**opt); end 100.times { foo({kw:1}) } ``` ``` $ ./miniruby -e 'def foo(**opt); end; 100.times { foo({kw:1}) }' -e:1: warning: The last argument is used as the keyword parameter -e:1: warning: for `foo' defined here -e:1: warning: The last argument is used as the keyword parameter -e:1: warning: for `foo' defined here -e:1: warning: The last argument is used as the keyword parameter -e:1: warning: for `foo' defined here ... ``` In theory, the warnings are not harmful because they don't stop or interfere the execution. But in practice, I'm afraid if they are annoying because they flush all console logs away. I think that the warning is not needed if the call is already warned. ## Proposal How about limiting the count of warnings to at most once for each pair of caller and callee? I've created [a pull request](https://github.com/ruby/ruby/pull/2458). It records all pairs of caller position and callee iseq when emitting a warning, and suppress the warning if the same pair of caller and callee is already warned. What do you think? -- https://bugs.ruby-lang.org/