ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:50995] [Ruby master Bug#17575] deprecated style `respond_to?` warning with `-W:no-deprecated`
@ 2021-01-23 10:56 nobu
  2021-02-02  8:48 ` [ruby-dev:51009] " naruse
  0 siblings, 1 reply; 2+ messages in thread
From: nobu @ 2021-01-23 10:56 UTC (permalink / raw)
  To: 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-dev:51009] [Ruby master Bug#17575] deprecated style `respond_to?` warning with `-W:no-deprecated`
  2021-01-23 10:56 [ruby-dev:50995] [Ruby master Bug#17575] deprecated style `respond_to?` warning with `-W:no-deprecated` nobu
@ 2021-02-02  8:48 ` naruse
  0 siblings, 0 replies; 2+ messages in thread
From: naruse @ 2021-02-02  8:48 UTC (permalink / raw)
  To: 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-02  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-23 10:56 [ruby-dev:50995] [Ruby master Bug#17575] deprecated style `respond_to?` warning with `-W:no-deprecated` nobu
2021-02-02  8:48 ` [ruby-dev:51009] " naruse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).