summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-10-25 22:39:36 +0800
committerGitHub <noreply@github.com>2022-10-25 22:39:36 +0800
commit2d3e3ab5277beaa1cfcb746ea3f37b91fea42e59 (patch)
tree3047668d7a54ae14683c0a7b2ce472c9cc15c803
parent69eaa4f14cdb1276650141adb6b2e96f478e0856 (diff)
downloadNim-2d3e3ab5277beaa1cfcb746ea3f37b91fea42e59.tar.gz
closes #6213 #11777; add testcase (#20656)
-rw-r--r--tests/types/ttopdowninference.nim27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/types/ttopdowninference.nim b/tests/types/ttopdowninference.nim
index a637b167c..e4a340034 100644
--- a/tests/types/ttopdowninference.nim
+++ b/tests/types/ttopdowninference.nim
@@ -217,3 +217,30 @@ block: # bug #11085
 
   var bad: set[char] = block:
     {}
+
+# bug #6213
+block:
+  block:
+    type MyEnum = enum a, b
+    type MyTuple = tuple[x: set[MyEnum]]
+
+    var myVar: seq[MyTuple] = @[ (x: {}) ]
+    doAssert myVar.len == 1
+
+  block:
+    type
+      Foo = tuple
+        f: seq[string]
+        s: string
+
+    proc e(): seq[Foo] =
+      return @[
+        (@[], "asd")
+      ]
+
+    doAssert e()[0].f == @[]
+
+block: # bug #11777
+  type S = set[0..5]
+  var s: S = {1, 2}
+  doAssert 1 in s