From 464a849184734db84184254f90f2b83c55bfe3ed Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 23 Nov 2025 13:58:50 -0500 Subject: [PATCH] Handle destroying implicit parameter Fixes #3740 --- src/prism.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/prism.c b/src/prism.c index a5475b1753..2e0c941918 100644 --- a/src/prism.c +++ b/src/prism.c @@ -13849,6 +13849,18 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod // syntax error. In this case we'll fall through to our default // handling. We need to free the value that we parsed because there // is no way for us to attach it to the tree at this point. + switch (PM_NODE_TYPE(value)) { + case PM_LOCAL_VARIABLE_READ_NODE: + case PM_IT_LOCAL_VARIABLE_READ_NODE: + // Since it is possible for the value to be an implicit + // parameter, we need to remove it from the list of implicit + // parameters. + parse_target_implicit_parameter(parser, value); + break; + default: + break; + } + pm_node_destroy(parser, value); } PRISM_FALLTHROUGH