Project

General

Profile

Actions

Bug #1298

closed

wrong value for Hash of Hash

Added by phasis68 (Heesob Park) almost 16 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
Backport:
[ruby-core:22921]

Description

=begin
I found wrong hash value for hash of hash in 1.9.1

In ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
irb(main):001:0> h = {}
=> {}
irb(main):002:0> h[1]=2
=> 2
irb(main):003:0> h[h]=3
=> 3
irb(main):004:0> h
=> {1=>2, {...}=>3}
irb(main):005:0> h[h]
=> 3
irb(main):006:0> h[h]=4
=> 4
irb(main):007:0> h
=> {1=>2, {...}=>4}
irb(main):008:0> h[h]
=> 4

In ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
irb(main):001:0> h = {}
=> {}
irb(main):002:0> h[1]=2
=> 2
irb(main):003:0> h[h]=3
=> 3
irb(main):004:0> h
=> {1=>2, {...}=>3}
irb(main):005:0> h[h]
=> nil
irb(main):006:0> h[h]=4
=> 4
irb(main):007:0> h
=> {1=>2, {...}=>3, {...}=>4}
irb(main):008:0> h[h]
=> nil
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0