ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:119328] [Ruby master Bug#20764] Forwarding parameter `...` is wrongly allowed in lambda
@ 2024-09-28  5:48 tompng (tomoya ishida) via ruby-core
  0 siblings, 0 replies; only message in thread
From: tompng (tomoya ishida) via ruby-core @ 2024-09-28  5:48 UTC (permalink / raw)
  To: ruby-core; +Cc: tompng (tomoya ishida)

Issue #20764 has been reported by tompng (tomoya ishida).

----------------------------------------
Bug #20764: Forwarding parameter `...` is wrongly allowed in lambda
https://bugs.ruby-lang.org/issues/20764

* Author: tompng (tomoya ishida)
* Status: Open
* ruby -v: ruby 3.4.0dev (2024-09-27T00:58:32Z master 0c25eb4ffe) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
These codes are all syntax error
~~~ruby
->...{}
->(...){}
->(a,...){}
~~~
But these are allowed in --parser=parse.y. It should be syntax error
~~~ruby
->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)
~~~



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-28  5:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-28  5:48 [ruby-core:119328] [Ruby master Bug#20764] Forwarding parameter `...` is wrongly allowed in lambda tompng (tomoya ishida) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).