mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Merge 0ce874b329
into a04555c8ab
This commit is contained in:
commit
fccc80dadd
2 changed files with 12 additions and 1 deletions
|
@ -2712,6 +2712,18 @@ class TestRefinement < Test::Unit::TestCase
|
|||
INPUT
|
||||
end
|
||||
|
||||
# [Bug #21265]
|
||||
def test_symbol_proc_from_using_scope
|
||||
assert_separately([], <<~RUBY)
|
||||
class RefinedScope
|
||||
using(Module.new { refine(Kernel) { def itself = 0 } })
|
||||
ITSELF = :itself.to_proc
|
||||
end
|
||||
|
||||
assert_equal(1, RefinedScope::ITSELF[1])
|
||||
RUBY
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def eval_using(mod, s)
|
||||
|
|
|
@ -1955,7 +1955,6 @@ resolve_refined_method(VALUE refinements, const rb_method_entry_t *me, VALUE *de
|
|||
|
||||
tmp_me = me->def->body.refined.orig_me;
|
||||
if (tmp_me) {
|
||||
if (defined_class_ptr) *defined_class_ptr = tmp_me->defined_class;
|
||||
return tmp_me;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue