Actions
Bug #21927
closedPrism: misleading error message for forwarding in lambda argument
Bug #21927:
Prism: misleading error message for forwarding in lambda argument
Description
Even in a forwarding method:
$ ruby --parser=prism -e 'def m(...) ->(...){}; end'
-e: -e:1: syntax error found (SyntaxError)
> 1 | def m(...) ->(...){}; end
| ^~~ unexpected ... when the parent method is not forwarding
This message is proper for method arguments:
$ ruby --parser=prism -e 'def m() p(...); end'
-e: -e:1: syntax error found (SyntaxError)
> 1 | def m() p(...); end
| ^~~ unexpected ... when the parent method is not forwarding
The message from parse.y is different; "unexpected ... in lambda argument":
$ ruby --parser=parse.y -e 'def m(...) ->(...){}; end'
-e:1: unexpected ... in lambda argument
def m(...) ->(...){}; end
ruby: compile error (SyntaxError)
Updated by Earlopain (Earlopain _) about 4 hours ago
- Status changed from Open to Closed
Applied in changeset git|6af0de237935f162ee3089b314f0c33911d442da.
[ruby/prism] Fix error message for block/lambda with ... argument
They currently complain that the parent method is not forwarding.
But the actual problem is that these types of arguments simply don't
accept ...
Fixes [Bug #21927]
Actions