From efd37f8fc3e021c93f37d1f7f08fcb6b909d6ecf Mon Sep 17 00:00:00 2001 From: OKURA Masafumi Date: Sat, 17 Aug 2019 08:52:23 +0900 Subject: Remove redundant each from `sum` example (#2190) [ci skip] It used to be `Enumerator#sum`, now it's range of string which calls `Enumerable#sum` and causes TypeError. --- enum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index e090a27c8e..ba47d348a4 100644 --- a/enum.c +++ b/enum.c @@ -4017,7 +4017,7 @@ int_range_sum(VALUE beg, VALUE end, int excl, VALUE init) * { 1 => 10, 2 => 20 }.sum {|k, v| k * v } #=> 50 * (1..10).sum #=> 55 * (1..10).sum {|v| v * 2 } #=> 110 - * [Object.new].each.sum #=> TypeError + * ('a'..'z').sum #=> TypeError * * This method can be used for non-numeric objects by * explicit init argument. -- cgit v1.2.3