🚀

[Bug #21460] 特定のパターンマッチの構文で Ruby がクラッシュするというバグ報告

に公開

[Bug #21460] Pattern matching crash: unexpected PM_CALL_NODE

  • 次のようなパターンマッチの構文で Ruby がクラッシュするというバグ報告
foo => -1**2
  • これは Ruby 3.4 で再現しているみたい
  • これは開発版の Ruby 3.5-dev では SyntaxError になるように修正済み
foo => -1**2
__END__
output:
  /tmp/voewWzX/14: --> /tmp/voewWzX/14

expected a pattern expression after `=>`

> 1  foo => -1**2

/tmp/voewWzX/14:1: syntax error found (SyntaxError)
> 1 | foo => -1**2
|        ^~~~~ expected a pattern expression after `=>`
GitHubで編集を提案

Discussion