[ruby-core:73967] [Ruby trunk Bug#12072][Assigned] SortedSet#superset? raises NoMethodError if rbtree is installed

From: spiketeika@...
Date: 2016-02-25 01:58:33 UTC
List: ruby-core #73967
Issue #12072 has been updated by Kaneko Yuichiro.

Status changed from Open to Assigned
Assignee set to Akinori MUSHA

Same code doesn't work on Ruby 2.3.0, because the cause of this bug is [r52586](https://github.com/ruby/ruby/commit/d736eded9d4cb7ab5ddc693059d55f8d1e369c98).


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

* Author: Kazuki Yamaguchi
* Status: Assigned
* Priority: Normal
* Assignee: Akinori MUSHA
* 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>

In This Thread

Prev Next