1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Make the metaclass of Refinement explicitly

Otherwise, singleton methods of Module are not inherited unless
Refinement.singleton_class is called.
This commit is contained in:
Shugo Maeda 2021-10-26 19:34:27 +09:00
parent 8a49c7e481
commit 37395ffa05
No known key found for this signature in database
GPG key ID: 2DFE34085E97CE47
2 changed files with 6 additions and 0 deletions

View file

@ -689,6 +689,8 @@ Init_class_hierarchy(void)
RBASIC_SET_CLASS(rb_cObject, rb_cClass);
RBASIC_SET_CLASS(rb_cRefinement, rb_cClass);
RBASIC_SET_CLASS(rb_cBasicObject, rb_cClass);
ENSURE_EIGENCLASS(rb_cRefinement);
}

View file

@ -2668,6 +2668,10 @@ class TestRefinement < Test::Unit::TestCase
end
end
def test_inherit_singleton_methods_of_module
assert_equal([], Refinement.used_modules)
end
private
def eval_using(mod, s)