Project

General

Profile

Actions

Bug #20092

closed

Warnings for anonymous parameters do not display in Ruby 3.4dev

Added by koic (Koichi ITO) 11 months ago. Updated 11 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.0dev (2023-12-26T22:32:38Z master be92bf4ff4) [x86_64-darwin22]
[ruby-core:115918]

Description

I encountered no expected warnings in Ruby 3.4dev.

Reproduction code

def anonymous(*, **, &)
  rest_block do
    foo(*)
  end

  kwrest_block do
    bar(**)
  end

  block_block do
    baz(&)
  end
end

Expected Behavior (Ruby 3.3.0)

Warnings are displayed:

$ ruby -vc example.rb
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]
example.rb: example.rb:3: anonymous rest parameter is also used within block (SyntaxError)
example.rb:7: anonymous keyword rest parameter is also used within block
example.rb:11: anonymous block parameter is also used within block

Actual Behavior (Ruby 3.4dev)

No warning displayed:

$ ruby -vc example.rb
ruby 3.4.0dev (2023-12-26T22:32:38Z master be92bf4ff4) [x86_64-darwin22]
Syntax OK
Actions

Also available in: Atom PDF

Like0
Like1Like0