Remove deprecated method Refinement#refined_class

[Feature #20901]
This commit is contained in:
Shugo Maeda 2024-11-19 13:41:39 +09:00 коммит произвёл Shugo Maeda
Родитель 9c777f282f
Коммит 7ed027a833
3 изменённых файлов: 4 добавлений и 22 удалений

Просмотреть файл

@ -51,6 +51,10 @@ Note: We're only listing outstanding class updates.
#=> [2022-02-24 00:00:00 UTC, 2022-02-25 00:00:00 UTC, 2022-02-26 00:00:00 UTC]
```
* Refinement
* Removed deprecated method Refinement#refined_class. [[Feature #19714]]
* RubyVM::AbstractSyntaxTree
* Add RubyVM::AbstractSyntaxTree::Node#locations method which returns location objects

16
eval.c
Просмотреть файл

@ -1403,21 +1403,6 @@ rb_refinement_module_get_refined_class(VALUE module)
return rb_attr_get(module, id_refined_class);
}
/*
* call-seq:
* refined_class -> class
*
* Deprecated; prefer #target.
*
* Return the class refined by the receiver.
*/
static VALUE
rb_refinement_refined_class(VALUE module)
{
rb_warn_deprecated_to_remove("3.4", "Refinement#refined_class", "Refinement#target");
return rb_refinement_module_get_refined_class(module);
}
static void
add_activated_refinement(VALUE activated_refinements,
VALUE klass, VALUE refinement)
@ -2131,7 +2116,6 @@ Init_eval(void)
rb_undef_method(rb_cClass, "refine");
rb_define_private_method(rb_cRefinement, "import_methods", refinement_import_methods, -1);
rb_define_method(rb_cRefinement, "target", rb_refinement_module_get_refined_class, 0);
rb_define_method(rb_cRefinement, "refined_class", rb_refinement_refined_class, 0);
rb_undef_method(rb_cRefinement, "append_features");
rb_undef_method(rb_cRefinement, "prepend_features");
rb_undef_method(rb_cRefinement, "extend_object");

Просмотреть файл

@ -1824,13 +1824,7 @@ class TestRefinement < Test::Unit::TestCase
end
}.refinements
assert_equal(Integer, refinements[0].target)
assert_warn(/Refinement#refined_class is deprecated and will be removed in Ruby 3.4; use Refinement#target instead/) do
assert_equal(Integer, refinements[0].refined_class)
end
assert_equal(String, refinements[1].target)
assert_warn(/Refinement#refined_class is deprecated and will be removed in Ruby 3.4; use Refinement#target instead/) do
assert_equal(String, refinements[1].refined_class)
end
end
def test_warn_setconst_in_refinmenet