From: Charles Oliver Nutter Date: 2007-03-29T14:13:14+09:00 Subject: Bug in String#[]: using object ID instead of to_int This seems like a bug... class Foo def to_int 3 end end x = Foo.new p x.object_id y = "hello" y[x] = "t" ...prints out... 76260 test.rb:10:in `[]=': index 76260 out of string (IndexError) from test.rb:10 So it appears that even though to_int is defined on my Foo class, aref tries to use the object ID to index into the string. It should use the result of to_int, no? - Charlie