From: Kornelius Kalnbach Date: 2008-12-30T23:48:36+09:00 Subject: [ruby-core:20992] [Bug #954] OpenStruct#inspect recursion detection is buggy Bug #954: OpenStruct#inspect recursion detection is buggy http://redmine.ruby-lang.org/issues/show/954 Author: Kornelius Kalnbach Status: Open, Priority: Normal Category: core, Target version: 1.9.1 Currently, OpenStruct#inspect shows a recursion indicator whenever a member of an OpenStruct is an OpenStruct itself: foo = OpenStruct.new foo.bar = OpenStruct.new foo.inspect # => #> I expect it to do the following: foo = OpenStruct.new foo.bar = OpenStruct.new assert_equal('#>', foo.inspect) foo.bar.foo = foo assert_equal('#>>', foo.inspect) Path attached. It uses the code pattern found in Set#inspect, using object_ids instead of objects for the :__inspect_key__ stack. It should be fixed in Ruby 1.8.6 and 1.8.7, too. ---------------------------------------- http://redmine.ruby-lang.org