From e496e96547b64c3a2fa6f285c3bc9bd21a245ac6 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Sun, 25 Aug 2019 12:50:19 -0700 Subject: Document that Enumerable#sum may not respect redefinition of Range#each It already documented that it may not respect redefinition of Integer#+. Fixes [Bug #13700] --- enum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index ba47d348a4..bae32cb045 100644 --- a/enum.c +++ b/enum.c @@ -4026,7 +4026,7 @@ int_range_sum(VALUE beg, VALUE end, int excl, VALUE init) * "a\nb\nc".each_line.lazy.map(&:chomp).sum("") #=> "abc" * * Enumerable#sum method may not respect method redefinition of "+" - * methods such as Integer#+. + * methods such as Integer#+, or "each" methods such as Range#each. */ static VALUE enum_sum(int argc, VALUE* argv, VALUE obj) -- cgit v1.2.3