Project

General

Profile

Actions

Bug #18673

closed

Anonymous block forwarding fails when combined with keyword arguments

Added by brasic (Carl Brasic) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:108148]

Description

Hello!

I tried to use the anonymous block forwarding feature introduced in https://bugs.ruby-lang.org/issues/11256 and released with ruby 3.1.

Unfortunately it appears to unexpectedly fail during parsing when used in a method that also accepts keyword arguments. I don't see this limitation documented so I presume it is a bug. I've attached a simple reproduction script.

/cc @jeremyevans0 (Jeremy Evans) as author.

$ ruby -v
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux]
$ ruby anon_repro.rb
anon_repro.rb:14: no anonymous block parameter

Carl


Files

anon_repro.rb (223 Bytes) anon_repro.rb brasic (Carl Brasic), 03/31/2022 10:14 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0