aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-22 14:45:42 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-22 14:45:42 +0900
commitd2ac6d4d9f57b34eeb94bd6302b54a632051ce64 (patch)
tree2aa4f26fd1f543af632ed6830cbb82546b780c68 /compile.c
parent58527a79263c6572bd4f97d0a0e0359c0ace6f3c (diff)
downloadruby-d2ac6d4d9f57b34eeb94bd6302b54a632051ce64.tar.gz
Manage deprecation warning by the flag
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index c19112c853..56b91bfb46 100644
--- a/compile.c
+++ b/compile.c
@@ -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;