Issue #12072 has been reported by Kazuki Yamaguchi.

----------------------------------------
Bug #12072: SortedSet#superset? raises NoMethodError if rbtree is installed
https://bugs.ruby-lang.org/issues/12072

* Author: Kazuki Yamaguchi
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.4.0dev (2016-02-14 trunk 53823) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
If rbtree is installed, the following code doesn't work.

~~~ruby
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--------------------------------
0001-set-fix-SortedSet-superset-with-rbtree.patch (2.88 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>