mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
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