Project

General

Profile

Bug #117

SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSets

Added by NoKarma (Arthur Schreiber) almost 12 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
[ruby-core:17145]

Description

=begin
set1 = SortedSet[1, 2]
set2 = SortedSet[3, 4, SortedSet[5, 6]]
set1.send(:flatten_merge, set2) # => raises a NoMethodError: undefined method `<=>' for #

SortedSet[1, 2, SortedSet[3, 4, SortedSet[5, 6, SortedSet[7, 8]]], 9, 10].flatten # => raises a NoMethodError: undefined method `<=>' for #SortedSet:0x5f2be8

SortedSet[1, 2, SortedSet[3, 4]].flatten # => raises an ArgumentError: comparison of Fixnum with SortedSet failed
=end

Also available in: Atom PDF