diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-13 11:10:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-13 11:10:24 +0000 |
commit | 384fda18b885872aacf225ac6ad7805fb101e497 (patch) | |
tree | 4ce162ac23bd0b9a6e78a1f3c82fa57ea97480bf /array.c | |
parent | cff6bdfcba57995e1879c7a2003f9949aec29632 (diff) | |
download | ruby-384fda18b885872aacf225ac6ad7805fb101e497.tar.gz |
warn unused blocks with Enumerable#all? any? one? none?
[Fix GH-1953]
From: Koji Onishi <fursich0@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -5809,6 +5809,9 @@ rb_ary_any_p(int argc, VALUE *argv, VALUE ary) rb_check_arity(argc, 0, 1); if (!len) return Qfalse; if (argc) { + if (rb_block_given_p()) { + rb_warn("given block not used"); + } for (i = 0; i < RARRAY_LEN(ary); ++i) { if (RTEST(rb_funcall(argv[0], idEqq, 1, RARRAY_AREF(ary, i)))) return Qtrue; } |