Actions
Bug #21622
closedPrism wrongly accepts command call to be a key of keyword argument
Bug #21622:
Prism wrongly accepts command call to be a key of keyword argument
ruby -v:
ruby 3.5.0dev (2025-10-02T03:48:32Z master 88222caaa9) +PRISM [x86_64-linux]
Updated by Earlopain (Earlopain _) 10 months ago
The first code examples are parsed like p((p a, &block) => value). https://github.com/ruby/prism/pull/3669 should fix this (and the other two as well)
Updated by alanwu (Alan Wu) 10 months ago
- Assignee set to prism
Updated by Earlopain (Earlopain _) 8 months ago
- Status changed from Open to Closed
Applied in changeset git|2870b7d7df30bc227f40a4c04c97050b90f1f25b.
[ruby/prism] Reject p(p a, &block => value) and similar
They were being parsed as p((p a, &block) => value).
When we get to this point, we must not just have parsed a command call, always consuming the => is not correct.
Closes [Bug #21622]
Actions