Project

General

Profile

Actions

Bug #21003

closed

unexpected warning about ignored block

Added by decuplet (Nikita Shilnikov) 4 days ago. Updated 2 days ago.

Status:
Closed
Assignee:
Target version:
-
ruby -v:
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
[ruby-core:120476]

Description

I stumbled upon this during the upgrade to 3.4. Here's the minimal repro:

$VERBOSE = true

def foo(*, &block) = block
def bar(buz, ...) = foo(buz, ...)

bar(:test) {}

It gives

ruby reproduce.rb
reproduce.rb:6: warning: the block passed to 'Object#bar' defined at reproduce.rb:4 may be ignored

where I believe it shouldn't. No warning reported if I change def bar(buz, ...) to def bar(...).

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0