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=-4.1 required=3.0 tests=AWL,BAYES_00, 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 6A77A1F4B4 for ; Sat, 23 Jan 2021 10:57:04 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 843CA120A22; Sat, 23 Jan 2021 19:56:11 +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 7F71C120974 for ; Sat, 23 Jan 2021 19:56:09 +0900 (JST) Received: by filterdrecv-p3las1-5d6fd766bd-czh49 with SMTP id filterdrecv-p3las1-5d6fd766bd-czh49-20-600C00F6-9 2021-01-23 10:56:54.15573015 +0000 UTC m=+302058.030424618 Received: from herokuapp.com (unknown) by geopod-ismtpd-5-9 (SG) with ESMTP id d9u6-dygSf6s4YdfGd_PYg for ; Sat, 23 Jan 2021 10:56:53.845 +0000 (UTC) Date: Sat, 23 Jan 2021 10:56:54 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 78123 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17575 X-Redmine-Issue-Author: nobu X-Redmine-Sender: nobu 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?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4Bz9lwnp=2F6RdFbugn8AEGM?= =?us-ascii?Q?bhNtbpVyymn=2F2GXUVADMQ1nAH5RICf=2FDnpxBMZD?= =?us-ascii?Q?nRUVKJ=2F0XOxI80ETZDDjm5OG7+efAtFRbztKy28?= =?us-ascii?Q?ZmHEFMAA+ZdWUdMIKvmF27NTgYErTvcKhaJV4Nv?= =?us-ascii?Q?Wp1WdYrh5o1fb+LTDtvEXAS381waf1mkBtKp=2Fyc?= =?us-ascii?Q?CExdJZrDCvn=2FFF1yE=3D?= To: ruby-dev@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-dev X-Mail-Count: 50995 Subject: [ruby-dev:50995] [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 reported by nobu (Nobuyoshi Nakada). ---------------------------------------- Bug #17575: deprecated style `respond_to?` warning with `-W:no-deprecated` https://bugs.ruby-lang.org/issues/17575 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Priority: Normal * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED ---------------------------------------- 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/