From 1e52dde82af10f2a2ec648b34dce30bec4154245 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 16 Sep 2024 11:14:31 -0400 Subject: [PATCH] [PRISM] Match defined behavior for explicit block Fixes [Bug #20748] --- prism_compile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prism_compile.c b/prism_compile.c index b1f9b00bf6..9ea89d64e1 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -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) {