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=-2.8 required=3.0 tests=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 shortcircuit=no autolearn=no 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 AE8451F454 for ; Mon, 11 Nov 2019 01:00:58 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8C84812098B; Mon, 11 Nov 2019 10:00:48 +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 3FFAD120988 for ; Mon, 11 Nov 2019 10:00:46 +0900 (JST) Received: by filter0110p3las1.sendgrid.net with SMTP id filter0110p3las1-32012-5DC8B2C2-41 2019-11-11 01:00:50.553995353 +0000 UTC m=+271179.562845349 Received: from herokuapp.com (unknown [35.171.185.2]) by ismtpd0120p1mdw1.sendgrid.net (SG) with ESMTP id 0oN4asrCQ1CkchwXuk2Zow for ; Mon, 11 Nov 2019 01:00:50.360 +0000 (UTC) Date: Mon, 11 Nov 2019 01:00:50 +0000 (UTC) From: sam.saffron@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71408 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16289 X-Redmine-Issue-Author: mame X-Redmine-Sender: sam.saffron 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?GD31AXMrLYtZC3ZmvheLkg5nAqKYtjT=2Fa5aksj98ZWPBoVlsapnATJjlPL+LgW?= =?us-ascii?Q?FRNmVM9vVpkB1GygZ3R3yYmaBGK+iKWcKtVRsrg?= =?us-ascii?Q?Q0KhqU+DGJ1aW87qnC1tW3+Kl6aKo1NHRJf2gu2?= =?us-ascii?Q?S5T=2FPdJgp9f3DCTJfaeAPw6MESklckcIxqfoDvf?= =?us-ascii?Q?mVZXAHdV0NmIxeAzvWgKmYnYtHUMorL6npA=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95783 Subject: [ruby-core:95783] [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 sam.saffron (Sam Saffron). Note... some of this fiddling with keyword arguments is showing up as a slowdown in rubybench https://rubybench.org/ruby/ruby/commits?result_type=app_answer&display_count=2000 ---------------------------------------- Feature #16289: Reduce duplicated warnings for the change of Ruby 3 keyword arguments https://bugs.ruby-lang.org/issues/16289#change-82607 * Author: mame (Yusuke Endoh) * Status: Open * Priority: Normal * Assignee: * 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/