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=-3.8 required=3.0 tests=BAYES_00, 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 117CD1F4B4 for ; Tue, 2 Feb 2021 08:49:02 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 55AB0120BBE; Tue, 2 Feb 2021 17:48:05 +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 B3D02120BBA for ; Tue, 2 Feb 2021 17:48:02 +0900 (JST) Received: by filterdrecv-p3mdw1-54f4cd47b7-zz9qd with SMTP id filterdrecv-p3mdw1-54f4cd47b7-zz9qd-19-601911F4-27 2021-02-02 08:48:52.364115229 +0000 UTC m=+378920.645621259 Received: from herokuapp.com (unknown) by geopod-ismtpd-5-4 (SG) with ESMTP id s3DVmlbbTjCy41r4OhpL6g for ; Tue, 02 Feb 2021 08:48:52.314 +0000 (UTC) Date: Tue, 02 Feb 2021 08:48:52 +0000 (UTC) From: naruse@airemix.jp Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 78296 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17575 X-Redmine-Issue-Author: nobu X-Redmine-Sender: naruse 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?UqoG4vcRhHM9V1I4f4J7DhjzUfTg+8muXbMD6UD+LVT72pa=2FALDNRSbVr=2FOPQa?= =?us-ascii?Q?YDcVWys9qBMhhf4Z4azQmegD1wRWQZvfnzBWsrs?= =?us-ascii?Q?AWanMnR8cFjitIXST8CBqNSTH1WtXRhKM16eVrL?= =?us-ascii?Q?vitIbkLa9I5r70=2F0uxoJLOdwroNqIFbFYDUDxtW?= =?us-ascii?Q?uqhGR24jdvp=2FL7nNPCMg9uAmkcIBLyHh2wVEZqG?= =?us-ascii?Q?lLJdGAzPcyClOa5to=3D?= To: ruby-dev@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-dev X-Mail-Count: 51009 Subject: [ruby-dev:51009] [Ruby master Bug#17575] deprecated style `respond_to?` warning with `-W:no-deprecated` X-BeenThere: ruby-dev@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: "Ruby developers \(Japanese\)" List-Id: "Ruby developers \(Japanese\)" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-dev-bounces@ruby-lang.org Sender: "ruby-dev" Issue #17575 has been updated by naruse (Yui NARUSE). Backport changed from 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE ruby_3_0 fb6cb226a03c2eeaf4fe68b282fcd6e4a8696ffd merged revision(s) 8dfae85adb96cf3da84bf38f2103969d4a7aed3f. ---------------------------------------- Bug #17575: deprecated style `respond_to?` warning with `-W:no-deprecated` https://bugs.ruby-lang.org/issues/17575#change-90240 * Author: nobu (Nobuyoshi Nakada) * Status: Closed * Priority: Normal * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE ---------------------------------------- When `respond_to?` is defined in deprecated style, arity == 1, is warned and the defined location is also reported. But if deprecation warning is disabled, the main message is disabled but the next line is still shown. ``` $ ruby -W:deprecated -e 'class << (obj = "test"); def respond_to?(m) true; end; def test; defined?(foo); end; end; p obj.test' -e:1: warning: test.respond_to?(:foo) uses the deprecated method signature, which takes one parameter -e:1: warning: respond_to? is defined here "method" ``` ``` $ ruby -W:no-deprecated -e 'class << (obj = "test"); def respond_to?(m) true; end; def test; defined?(foo); end; end; p obj.test' -e:1: warning: respond_to? is defined here "method" ``` -- https://bugs.ruby-lang.org/