[PRISM] Match defined behavior for explicit block

Fixes [Bug #20748]
This commit is contained in:
Kevin Newton 2024-09-16 11:14:31 -04:00
parent 50564f8882
commit 1e52dde82a
Notes: git 2024-09-16 15:54:13 +00:00

View File

@ -3889,6 +3889,12 @@ pm_compile_defined_expr0(rb_iseq_t *iseq, const pm_node_t *node, const pm_node_l
}
case PM_CALL_NODE: {
const pm_call_node_t *cast = ((const pm_call_node_t *) node);
if (cast->block != NULL && PM_NODE_TYPE_P(cast->block, PM_BLOCK_NODE)) {
dtype = DEFINED_EXPR;
break;
}
ID method_id = pm_constant_id_lookup(scope_node, cast->name);
if (cast->receiver || cast->arguments) {