This commit is contained in:
Alan Wu 2025-08-14 12:17:17 -04:00 committed by GitHub
commit fccc80dadd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -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)

View file

@ -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;
}