Skip to content

Commit 7ed027a

Browse files
committed
Remove deprecated method Refinement#refined_class
[Feature #20901]
1 parent 9c777f2 commit 7ed027a

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Note: We're only listing outstanding class updates.
5151
#=> [2022-02-24 00:00:00 UTC, 2022-02-25 00:00:00 UTC, 2022-02-26 00:00:00 UTC]
5252
```
5353

54+
* Refinement
55+
56+
* Removed deprecated method Refinement#refined_class. [[Feature #19714]]
57+
5458
* RubyVM::AbstractSyntaxTree
5559

5660
* Add RubyVM::AbstractSyntaxTree::Node#locations method which returns location objects

eval.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,21 +1403,6 @@ rb_refinement_module_get_refined_class(VALUE module)
14031403
return rb_attr_get(module, id_refined_class);
14041404
}
14051405

1406-
/*
1407-
* call-seq:
1408-
* refined_class -> class
1409-
*
1410-
* Deprecated; prefer #target.
1411-
*
1412-
* Return the class refined by the receiver.
1413-
*/
1414-
static VALUE
1415-
rb_refinement_refined_class(VALUE module)
1416-
{
1417-
rb_warn_deprecated_to_remove("3.4", "Refinement#refined_class", "Refinement#target");
1418-
return rb_refinement_module_get_refined_class(module);
1419-
}
1420-
14211406
static void
14221407
add_activated_refinement(VALUE activated_refinements,
14231408
VALUE klass, VALUE refinement)
@@ -2131,7 +2116,6 @@ Init_eval(void)
21312116
rb_undef_method(rb_cClass, "refine");
21322117
rb_define_private_method(rb_cRefinement, "import_methods", refinement_import_methods, -1);
21332118
rb_define_method(rb_cRefinement, "target", rb_refinement_module_get_refined_class, 0);
2134-
rb_define_method(rb_cRefinement, "refined_class", rb_refinement_refined_class, 0);
21352119
rb_undef_method(rb_cRefinement, "append_features");
21362120
rb_undef_method(rb_cRefinement, "prepend_features");
21372121
rb_undef_method(rb_cRefinement, "extend_object");

test/ruby/test_refinement.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,13 +1824,7 @@ def test_target
18241824
end
18251825
}.refinements
18261826
assert_equal(Integer, refinements[0].target)
1827-
assert_warn(/Refinement#refined_class is deprecated and will be removed in Ruby 3.4; use Refinement#target instead/) do
1828-
assert_equal(Integer, refinements[0].refined_class)
1829-
end
18301827
assert_equal(String, refinements[1].target)
1831-
assert_warn(/Refinement#refined_class is deprecated and will be removed in Ruby 3.4; use Refinement#target instead/) do
1832-
assert_equal(String, refinements[1].refined_class)
1833-
end
18341828
end
18351829

18361830
def test_warn_setconst_in_refinmenet

0 commit comments

Comments
 (0)