Bug #5146

Bug in Set#== on ruby 1.9.3-preview1

Added by Bernard LAMBEAU over 2 years ago. Updated over 2 years ago.

[ruby-core:38650]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:core
Target version:1.9.3
ruby -v:r30514 Backport:

Description

Hi!

Sorry for reporting this bug here, but I can't log into redmine even after
having
requested a new password...

Set#== seems buggy in ruby 1.9.3, as illustrated by the following scenario.
I can't reproduce the bug without using Hash#delete to get another empty
hash
than "{ }".

blambeau@kali:~/Temp$ cat test.rb

require 'set'
RUBY_VERSION
tuple = {:hello => "world"}
empty = tuple.dup
empty.delete(:hello)
puts empty == {}
puts Set.new([{}]) == Set.new([empty])

blambeau@kali:~/Temp$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

blambeau@kali:~/Temp$ ruby test.rb
true
true

[...]

blambeau@kali:~/Temp$ ruby --version
ruby 1.9.3dev (2011-07-31 revision 32789) [i686-linux]

blambeau@kali:~/Temp$ ruby test.rb
true
false

History

#1 Updated by Yui NARUSE over 2 years ago

  • Category set to lib
  • Status changed from Open to Assigned
  • Assignee set to Akinori MUSHA
  • Target version set to 1.9.3

Don't worry, ruby-core is also a correct bug reporting place.
(and we can make a ticket from mail)

Your account is locked (I don't why), so I unlocked it and resent the account information

#2 Updated by Nobuyoshi Nakada over 2 years ago

  • Category changed from lib to core
  • Status changed from Assigned to Closed
  • Assignee changed from Akinori MUSHA to Nobuyoshi Nakada
  • % Done changed from 0 to 100
  • ruby -v changed from - to r30514

It's a bug of Hash#hash and fixed at r32810.

Also available in: Atom PDF