Project

General

Profile

Actions

Bug #20973

closed

`it` in pattern matching pin operator causes BUG

Added by ktsj (Kazuki Tsujimoto) 2 days ago. Updated 1 day ago.

Status:
Closed
Target version:
ruby -v:
ruby 3.4.0dev (2024-12-20T00:48:01Z master 978df259ca) +PRISM [x86_64-linux]
[ruby-core:120342]

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>'
Actions

Also available in: Atom PDF

Like0
Like0