mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 06:56:13 +02:00
Prevent warnings "the block passed to ... may be ignored"
This commit is contained in:
parent
b6c7226fac
commit
0f3dc2f958
Notes:
git
2024-09-13 07:52:56 +00:00
5 changed files with 42 additions and 8 deletions
|
@ -3,7 +3,24 @@ require 'test/unit'
|
|||
require '-test-/iter'
|
||||
|
||||
class TestCall < Test::Unit::TestCase
|
||||
def aaa(a, b=100, *rest)
|
||||
# These dummy method definitions prevent warnings "the block passed to 'a'..."
|
||||
def a(&) = nil
|
||||
def b(&) = nil
|
||||
def c(&) = nil
|
||||
def d(&) = nil
|
||||
def e(&) = nil
|
||||
def f(&) = nil
|
||||
def g(&) = nil
|
||||
def h(&) = nil
|
||||
def i(&) = nil
|
||||
def j(&) = nil
|
||||
def k(&) = nil
|
||||
def l(&) = nil
|
||||
def m(&) = nil
|
||||
def n(&) = nil
|
||||
def o(&) = nil
|
||||
|
||||
def aaa(a, b=100, *rest, &)
|
||||
res = [a, b]
|
||||
res += rest if rest
|
||||
return res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue