Actions
Bug #18470
closedUnion of two identical sets produces a set with duplicate members
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
Description
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
C = Struct.new :id
a = Set.new
b = Set.new
f = C.new
a << f
f.id = 1
b << f
a + b
# => #<Set: {#<struct C id=1>, #<struct C id=1>}>
b + a
# => #<Set: {#<struct C id=1>}>
(a + b).uniq
=> [#<struct C id=1>]
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0