diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-12-24 18:49:57 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-12-24 18:53:14 +0900 |
commit | 4ba9347554ab1ac79fdaf1d5b3320776a2b10615 (patch) | |
tree | 20dce38eca235072f054d86fe12be65dc967b82c /object.c | |
parent | a3c5dbf29191aa8622d8be7d990c4ac2f9392427 (diff) |
`Object#=~` warning also obeys `Warning[:deprecated]`
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1624,8 +1624,10 @@ rb_false(VALUE obj) static VALUE rb_obj_match(VALUE obj1, VALUE obj2) { - rb_warn("deprecated Object#=~ is called on %"PRIsVALUE - "; it always returns nil", rb_obj_class(obj1)); + if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) { + rb_warn("deprecated Object#=~ is called on %"PRIsVALUE + "; it always returns nil", rb_obj_class(obj1)); + } return Qnil; } |