summaryrefslogtreecommitdiff
path: root/test/prism/errors/pattern_arithmetic_expressions.txt
AgeCommit message (Collapse)Author
2025-07-16[ruby/prism] Fix crash when using arithmetic expressions in pattern matchingStan Lo
When arithmetic expressions like `-1**2` are used in pattern matching contexts, Ruby crashes with "Unexpected node type in pattern matching expression: PM_CALL_NODE". This happens because the Prism parser creates `PM_CALL_NODE` for arithmetic operations, but Ruby's pattern matching compiler doesn't handle call nodes. This fix adds validation to reject `PM_CALL_NODE` in pattern contexts with a proper syntax error. https://github.com/ruby/prism/commit/365049a767