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 _) 20 days 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]
Updated by k0kubun (Takashi Kokubun) 3 days ago
- Backport changed from 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED, 4.0: REQUIRED to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED, 4.0: DONE
ruby_4_0 e7d2828fb677874fb425e6129e0c4c20acc0e1dd.
Actions