Issue #7493 has been updated by knu (Akinori MUSHA).


???????next?????蚊??莨若??篏?臀??1.8???1.9篁ラ????с?????c?????障?????
??翫????????<?純????????箴?????????????????????????????с????????

a=[1,2,3]
e=a.map!
p e.next #=> 1
p e.next #=> 2
p a #=> [nil, nil, 3] (1.8) [nil, 2, 3] (1.9+)

????1.8??с??next??у?ゃ??菴???c?????????yield?????????????????弱?冴??腟?篋???????緇?鐚???????????罨<??????????弱?冴???????c?????鐚???с????????
1.9篁ラ????с??????<?純????????yield????????翫?????帥?ゃ????潟?違?у?ゃ??菴???c??ャ??罨<??next??у?????<?純????????九勝?????祉????????????c?????障?????
鐚?1.9篁ラ?????????????????障??????????????障??鐚?
----------------------------------------
Bug #7493: ???????????羝<??????????翫???????????1荀?膣????帥??菴????Enumerator??絲??????next?????????膓???????????2綺???StopIteration箴?紊??????榊????????
https://bugs.ruby-lang.org/issues/7493#change-34317

Author: kachick (Kenichi Kamiya)
Status: Closed
Priority: Normal
Assignee: 
Category: 
Target version: Ruby 1.8.7
ruby -v: ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux]


???????????????????у?????????????翫?????????????????ゃ????c??1荀?膣????帥??菴??????<?純??????????????Enumerator???篏????????
2綺???next???StopIteration箴?紊????菴????????????с?????
????????潟?c??????????х∈茯?????????<?純?????????篁ヤ??????с?????

* Array#index
* Array#find_index
* Array#rindex
* Enumerable#detect
* Enumerable#find

??????????1.8.7???1.9???????罕????若?????綏?違???????????鴻?????????с???????????鐚?
???????????????Enumerator??絲??????to_a??????????????膣????????Array???菴????篋??????????
1.8.7???若??????????膣?莎井?糸?堺?ャ????鴻?????吟?с??<??????????????障????????

# to_a???綏??違???dbussink?????????ф????ャ??????????堺?ャ?障????????
# https://github.com/rubinius/rubinius/pull/2063#issuecomment-10881875

  array = [:a, :b, :c]
  index_enum = array.index
  index_enum.to_a #=> [:a, :b, :c]
  index_enum.next #=> :a
  index_enum.next #=> StopIteration: iteration reached at end


-- 
http://bugs.ruby-lang.org/