diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-25 12:50:19 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-25 12:50:19 -0700 |
commit | e496e96547b64c3a2fa6f285c3bc9bd21a245ac6 (patch) | |
tree | de206dd2320c63a9a202bdd3d11d86e57a2bdb28 /enum.c | |
parent | 71d97a5ef80a23b0bb1005570ed059580981a467 (diff) | |
download | ruby-e496e96547b64c3a2fa6f285c3bc9bd21a245ac6.tar.gz |
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]
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |