Actions
Bug #12072
closedSortedSet#superset? raises NoMethodError if rbtree is installed
Description
If rbtree is installed, the following code doesn't work.
require "set"
set_a = SortedSet.new([1, 2])
set_b = SortedSet.new([1, 2, 3])
p set_a >= set_b
# /home/k/.rbenv/versions/trunk/lib/ruby/2.4.0/set.rb:223:in `superset?': undefined method `>=' for #<RBTree: {1=>true, 2=>true}, default=nil, cmp_proc=nil> (NoMethodError)
# from test.rb:6:in `<main>'
I attached a patch for this.
Files
Updated by yui-knk (Kaneko Yuichiro) about 9 years ago
- Status changed from Open to Assigned
- Assignee set to knu (Akinori MUSHA)
Same code doesn't work on Ruby 2.3.0, because the cause of this bug is r52586.
Updated by knu (Akinori MUSHA) over 7 years ago
- Status changed from Assigned to Closed
Applied in changeset trunk|r60312.
Fix comparison methods of Set to check if @hash
is actually comparable
This should fix comparison of rbtree backed SortedSet instances.
[Bug #12072]
Actions
Like0
Like0Like0