Project

General

Profile

Actions

Bug #12072

closed

SortedSet#superset? raises NoMethodError if rbtree is installed

Added by rhenium (Kazuki Yamaguchi) about 8 years ago. Updated over 6 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-02-14 trunk 53823) [x86_64-linux]
[ruby-core:73807]

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 8 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.

Actions #2

Updated by knu (Akinori MUSHA) over 6 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

Also available in: Atom PDF

Like0
Like0Like0