summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2025-01-05 13:29:55 -0500
committerKevin Newton <kddnewton@gmail.com>2025-01-05 19:56:21 -0500
commit2a1cff40f5e7875f69a7d0ed59eab92cc86c65ff (patch)
treecd89b542019416cdd1175d83db1a6df1701b3077 /test/ruby
parentc037f5a28c54b86139ef17db061fdbf7dc82fd32 (diff)
Do not warn unused block when using forwarding
Fixes [Bug #21003]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12512
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_method.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 0707d61f1b..5d5d5aac02 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -1776,5 +1776,13 @@ class TestMethod < Test::Unit::TestCase
RUBY
assert_equal 0, err.size, err.join("\n")
end
+
+ assert_in_out_err '-w', <<-'RUBY' do |_out, err, _status|
+ def foo(*, &block) = block
+ def bar(buz, ...) = foo(buz, ...)
+ bar(:test) {} # do not warn because of forwarding
+ RUBY
+ assert_equal 0, err.size, err.join("\n")
+ end
end
end