summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorOKURA Masafumi <masafumi.o1988@gmail.com>2019-08-17 08:52:23 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 08:52:23 +0900
commitefd37f8fc3e021c93f37d1f7f08fcb6b909d6ecf (patch)
tree2fec27f25b477333070be6ca01bc4f65cad1102c /enum.c
parent7624154595eb71333a61b37f4c7388b6c031e878 (diff)
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.
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index e090a27..ba47d34 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 <i>init</i> argument.