Revert "[Bug #21256] Fix it parameter when splatting and define_method is…"

This reverts commit 265059603c.
This commit is contained in:
Yusuke Endoh 2025-07-18 12:22:18 +09:00
parent 81515aca67
commit dc8ae24951
2 changed files with 0 additions and 24 deletions

View file

@ -6777,17 +6777,6 @@ pm_compile_scope_node(rb_iseq_t *iseq, pm_scope_node_t *scope_node, const pm_nod
body->param.flags.has_lead = true;
}
if (scope_node->parameters && PM_NODE_TYPE_P(scope_node->parameters, PM_IT_PARAMETERS_NODE)) {
const uint8_t param_name[] = { 'i', 't' };
pm_constant_id_t constant_id = pm_constant_pool_find(&scope_node->parser->constant_pool, param_name, 2);
RUBY_ASSERT(constant_id && "parser should fill in `it` parameter");
pm_insert_local_index(constant_id, local_index, index_lookup_table, local_table_for_iseq, scope_node);
local_index++;
body->param.lead_num = 1;
body->param.flags.has_lead = true;
}
//********END OF STEP 3**********
//********STEP 4**********

View file

@ -1957,19 +1957,6 @@ eom
assert_equal(/9/, eval('9.then { /#{it}/o }'))
end
def test_it_with_splat_super_method
bug21256 = '[ruby-core:121592] [Bug #21256]'
a = Class.new do
define_method(:foo) { it }
end
b = Class.new(a) do
def foo(*args) = super
end
assert_equal(1, b.new.foo(1), bug21256)
end
def test_value_expr_in_condition
mesg = /void value expression/
assert_syntax_error("tap {a = (true ? next : break)}", mesg)