ruby-changes:59369
From: Nobuyoshi <ko1@a...>
Date: Sun, 22 Dec 2019 15:10:07 +0900 (JST)
Subject: [ruby-changes:59369] d2ac6d4d9f (master): Manage deprecation warning by the flag
https://git.ruby-lang.org/ruby.git/commit/?id=d2ac6d4d9f From d2ac6d4d9f57b34eeb94bd6302b54a632051ce64 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 22 Dec 2019 14:45:42 +0900 Subject: Manage deprecation warning by the flag diff --git a/compile.c b/compile.c index c19112c..56b91bf 100644 --- a/compile.c +++ b/compile.c @@ -7108,8 +7108,10 @@ check_yield_place(const rb_iseq_t *iseq, int line) https://github.com/ruby/ruby/blob/trunk/compile.c#L7108 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; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/