Actions
Bug #20764
closedForwarding parameter `...` is wrongly allowed in lambda
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-09-27T00:58:32Z master 0c25eb4ffe) +PRISM [x86_64-linux]
Description
These codes are all syntax error
->...{}
->(...){}
->(a,...){}
But these are allowed in --parser=parse.y. It should be syntax error
->a,...{}
->(a=1,...){}
# ruby --parser=parse.y -e "p ->a,...{}.parameters"
[[:opt, :b], [:rest, :*], [:keyrest, :**], [:block, :&]]
# ruby --parser=parse.y -e "p ->(a=1,...){}.parameters"
[[:opt, :b], [:rest, :*], [:keyrest, :**], [:block, :&]]
# ruby --parser=parse.y -e "p ->(a,...){}.parameters"
-e:1: syntax error, unexpected ...
p ->(a,...){}.parameters
ruby: compile error (SyntaxError)
Actions
Like0
Like0