Actions
Bug #17575
closeddeprecated style `respond_to?` warning with `-W:no-deprecated`
Description
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"
Actions
Like0
Like0Like0