1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Object#=~ warning also obeys Warning[:deprecated]

This commit is contained in:
Nobuyoshi Nakada 2019-12-24 18:49:57 +09:00
parent a3c5dbf291
commit 4ba9347554
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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;
}