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:
parent
8a49c7e481
commit
37395ffa05
2 changed files with 6 additions and 0 deletions
2
class.c
2
class.c
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue