Actions
Bug #20973
closed`it` in pattern matching pin operator causes BUG
ruby -v:
ruby 3.4.0dev (2024-12-20T00:48:01Z master 978df259ca) +PRISM [x86_64-linux]
Description
$ ./miniruby --parser=prism -e 'tap { 0 => ^it }'
-e: [BUG] Unexpected node type in pattern matching expression: PM_IT_LOCAL_VARIABLE_READ_NODE
ruby 3.4.0dev (2024-12-20T00:48:01Z master 978df259ca) +PRISM [x86_64-linux]
With parse.y, it passes.
$ ./miniruby --parser=parse.y -e 'tap { 0 => ^it }'
-e:1:in 'block in <main>': 0: main === 0 does not return true (NoMatchingPatternError)
from <internal:kernel>:91:in 'Kernel#tap'
from -e:1:in '<main>'
Updated by eightbitraptor (Matt V-H) 2 days ago
- Status changed from Assigned to Closed
Applied in changeset git|e8d393c8ae0c6282262b7a7886947379a9fd81a3.
[PRISM] Treat it as a local when compiling patterns
Fixes [Bug #20973]
Actions
Like0
Like0