[Ironruby-core] Bug filed: Array#hash should properly handle recursive arrays

Shri Borde Shri.Borde at microsoft.com
Thu Apr 16 18:05:48 EDT 2009

I can fix RubyArray.GetHashCode to handle the simple case of an array containing itself.

However, the simple fix wont deal with the case where the array is indirectly recursive as in this snippet.
  a = []
  b = [a]

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri
Sent: Thursday, April 16, 2009 2:20 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Bug filed: Array#hash should properly handle recursive arrays


I have just filed this bug on CodePlex:

It is actually pretty easy to fix with a bunch of lines of code in
RubyArray.GetHashCode (just tested, too bad IronRuby.dll is not open
to contributions) and, as a result, this would resolve the following 4
critical failures for the array core specs:

Array#hash properly handles recursive arrays
Array#| properly handles recursive arrays
Array#uniq properly handles recursive arrays
Array#uniq! properly handles recursive arrays


Daniele Alessandri
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list