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]
This commit is contained in:
Jeremy Evans 2019-08-25 12:50:19 -07:00
Родитель 71d97a5ef8
Коммит e496e96547
1 изменённых файлов: 1 добавлений и 1 удалений

2
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)