[MacRuby] #868: Should not get a value until calling Hash#rehash when Object of Hash's key was changed.
MacRuby
ruby-noreply at macosforge.org
Sat Aug 21 00:20:29 PDT 2010
#868: Should not get a value until calling Hash#rehash when Object of Hash's key
was changed.
----------------------------------+-----------------------------------------
Reporter: watson1978@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
----------------------------------+-----------------------------------------
Test Script:
{{{
#!ruby
$ cat test_rehash.rb
def assert_equal(a, b)
p b
p a == b
puts "-----"
end
def assert_nil(a)
p a
p a == nil
puts "-----"
end
a = [ "a", "b" ]
c = [ "c", "d" ]
h = { a => 100, c => 300 }
assert_equal(100, h[a])
a[0] = "z"
assert_nil(h[a])
h.rehash
assert_equal(100, h[a])
}}}
Result of Ruby 1.9.1:
{{{
$ ruby test_rehash.rb
100
true
-----
nil
true
-----
100
true
-----
}}}
Result of MacRuby Trunk:
{{{
$ macruby test_rehash.rb
100
true
-----
100
false
-----
100
true
-----
}}}
This problem may be related to #791.
--
Ticket URL: <http://www.macruby.org/trac/ticket/868>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list