Project

General

Profile

Actions

Bug #117

closed

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

Added by NoKarma (Arthur Schreiber) almost 16 years ago. Updated about 13 years ago.

Status:
Closed
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: {5, 6}>

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0