Issue #992 has been updated by Loqi Tamaroon.


Please disregard the part about the 'end' keyword. This is how the notes should be worded:

# The above method is supposed to return { :x => [:a, :b] } . Instead, it exhibits
# bizarre behavior. On the first iteration of the inner loop, line (~2) somehow causes
# flipped_hash to be recast from Hash {:x=>[:a]} to Array [:x] . This causes (~1) to
# raise a "Symbol as array index (TypeError)" exception on the second iteration of
# array_x.each , because flipped_hash has accedentally become an Array. A workaround
# is to uncomment (~4), which curiously is OUTSIDE the inner loop where the exception
# would've occured. Somehow this fixes the problem, and the method returns the expected result.


----------------------------------------
http://redmine.ruby-lang.org/issues/show/992

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