diff --git a/prism_compile.c b/prism_compile.c index d9c2038081d66a..7269fbc868b3ab 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -3029,6 +3029,7 @@ pm_compile_pattern(rb_iseq_t *iseq, pm_scope_node_t *scope_node, const pm_node_t case PM_GLOBAL_VARIABLE_READ_NODE: case PM_IMAGINARY_NODE: case PM_INSTANCE_VARIABLE_READ_NODE: + case PM_IT_LOCAL_VARIABLE_READ_NODE: case PM_INTEGER_NODE: case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: case PM_INTERPOLATED_STRING_NODE: diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 25f098f5624a69..0971fa16642621 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -2526,6 +2526,7 @@ def test_PinnedVariableNode assert_prism_eval("module Prism; @prism = 1; 1 in ^@prism; end") assert_prism_eval("$prism = 1; 1 in ^$prism") assert_prism_eval("prism = 1; 1 in ^prism") + assert_prism_eval("[1].each { 1 => ^it }") end ############################################################################