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

Manage deprecation warning by the flag

This commit is contained in:
Nobuyoshi Nakada 2019-12-22 14:45:42 +09:00
parent 58527a7926
commit d2ac6d4d9f
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -7108,8 +7108,10 @@ check_yield_place(const rb_iseq_t *iseq, int line)
return FALSE;
case ISEQ_TYPE_CLASS:
file = rb_iseq_path(iseq);
rb_compile_warn(RSTRING_PTR(file), line,
"`yield' in class syntax will not be supported from Ruby 3.0. [Feature #15575]");
if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) {
rb_compile_warn(RSTRING_PTR(file), line,
"`yield' in class syntax will not be supported from Ruby 3.0. [Feature #15575]");
}
return TRUE;
default:
return TRUE;