diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-11-19 12:43:38 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-11-19 12:43:38 +0900 |
commit | 9c777f282f8482400d4b0c7993d520c18cb1b652 () | |
tree | 087709ecbc982385e5492a170df770ee684842e7 | |
parent | 727b2a29990022fc96eddb4c63271f0eac60d926 (diff) |
[Bug #20900] Warn deprecated constant when removing
Notes: Merged: https://.com/ruby/ruby/pull/12114
-rw-r--r-- | spec/ruby/core/module/deprecate_constant_spec.rb | 9 | ||||
-rw-r--r-- | test/ruby/test_module.rb | 5 | ||||
-rw-r--r-- | variable.c | 1 |
3 files changed, 12 insertions, 3 deletions
@@ -44,6 +44,15 @@ describe "Module#deprecate_constant" do end end it "accepts multiple symbols and strings as constant names" do @module.deprecate_constant "PUBLIC1", :PUBLIC2 @@ -2148,9 +2148,8 @@ class TestModule < Test::Unit::TestCase Warning[:deprecated] = false Class.new(c)::FOO end - assert_warn('') do - Warning[:deprecated] = false - c.class_eval "FOO" end end @@ -3280,6 +3280,7 @@ rb_const_remove(VALUE mod, ID id) undefined_constant(mod, ID2SYM(id)); } rb_clear_constant_cache_for_id(id); val = ce->value; |