From: "smokinggun (John Weir)" Date: 2022-01-10T20:29:04+00:00 Subject: [ruby-core:107028] [Ruby master Bug#18470] Union of two identical sets produces a set with duplicate members Issue #18470 has been reported by smokinggun (John Weir). ---------------------------------------- Bug #18470: Union of two identical sets produces a set with duplicate members https://bugs.ruby-lang.org/issues/18470 * Author: smokinggun (John Weir) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- We came across an issue where the union of two identical sets produced a non uniq Set. We noticed this when upgrading from 2.7.1 to 3.1 See the attached test, the last assertion fails ``` ruby C = Struct.new :id a = Set.new b = Set.new f = C.new a << f f.id = 1 b << f a + b # => #, #}> b + a # => #}> (a + b).uniq => [#] ``` ---Files-------------------------------- set_test.rb (348 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: