Issue #9139 has been reported by dostapn (Dima Ostapenko).

----------------------------------------
Bug #9139: each_with_index
https://bugs.ruby-lang.org/issues/9139

Author: dostapn (Dima Ostapenko)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Whats wrong with index?

> Array.new(4, Hash.new).each_with_index{ |item, index| item["index"] = index; item["value"] = 10*index; p index;}
0
1
2
3
=> [{"index"=>3, "value"=>30},
 {"index"=>3, "value"=>30},
 {"index"=>3, "value"=>30},
 {"index"=>3, "value"=>30}]




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