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=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 206671F463 for ; Mon, 23 Dec 2019 17:47:49 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id D7BF5120AE6; Tue, 24 Dec 2019 02:47: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 4BB79120AE5 for ; Tue, 24 Dec 2019 02:47:30 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-72qfl with SMTP id filterdrecv-p3mdw1-56c97568b5-72qfl-18-5E00FDB6-16 2019-12-23 17:47:34.224483842 +0000 UTC m=+579867.080339240 Received: from herokuapp.com (unknown [18.233.7.172]) by ismtpd0041p1iad2.sendgrid.net (SG) with ESMTP id oq1trW-nReOcQFP6BPv6Ow for ; Mon, 23 Dec 2019 17:47:34.168 +0000 (UTC) Date: Mon, 23 Dec 2019 17:47:34 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72098 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16289 X-Redmine-Issue-Author: mame X-Redmine-Issue-Assignee: mame X-Redmine-Sender: jeremyevans0 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?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BI+ctS+7FjeR9JjFD1+p=2F5fV6gtuoZfGhPy33N0?= =?us-ascii?Q?ulZwqHafqOQ+YwMKuphaJMTcl1=2FsDnG05HP8t96?= =?us-ascii?Q?ytp43DB2PfOfauKUNgkI8p0t=2FL7AAEyiNpPFWpQ?= =?us-ascii?Q?Yo=2FSkmTMHHZK0k6hDuYHCbpmJ8e1poSKFbmfgLP?= =?us-ascii?Q?NUHU8L736XsetJohA=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96439 Subject: [ruby-core:96439] [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 jeremyevans0 (Jeremy Evans). I'm fine with @marcandre's changes. ---------------------------------------- Feature #16289: Reduce duplicated warnings for the change of Ruby 3 keyword arguments https://bugs.ruby-lang.org/issues/16289#change-83361 * Author: mame (Yusuke Endoh) * Status: Assigned * 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/