summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/collections/intsets.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/pure/collections/intsets.nim b/lib/pure/collections/intsets.nim
index 8b7703804..8338ceaca 100644
--- a/lib/pure/collections/intsets.nim
+++ b/lib/pure/collections/intsets.nim
@@ -387,6 +387,7 @@ proc assign*(dest: var IntSet, src: IntSet) =
   else:
     dest.counter = src.counter
     dest.max = src.max
+    dest.elems = src.elems
     newSeq(dest.data, src.data.len)
 
     var it = src.head
@@ -653,3 +654,19 @@ when isMainModule:
   xs = toSeq(items(x))
   xs.sort(cmp[int])
   assert xs == @[1, 4, 7, 1001, 1056]
+
+  proc bug12366 =
+    var
+      x = initIntSet()
+      y = initIntSet()
+      n = 3584
+
+    for i in 0..n:
+      x.incl(i)
+      y.incl(i)
+
+    let z = symmetricDifference(x, y)
+    doAssert z.len == 0
+    doAssert $z == "{}"
+
+  bug12366()