Prevent warnings "the block passed to ... may be ignored"

This commit is contained in:
Yusuke Endoh 2024-09-13 13:48:51 +09:00
parent b6c7226fac
commit 0f3dc2f958
Notes: git 2024-09-13 07:52:56 +00:00
5 changed files with 42 additions and 8 deletions

View file

@ -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