summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJasper Jenkins <jasper.vs.jenkins@gmail.com>2019-05-08 14:29:42 -0700
committerJasper Jenkins <jasper.vs.jenkins@gmail.com>2019-05-08 14:29:42 -0700
commit55a3b51e40a7d3301a114a66712c5daebae0ac6d (patch)
tree99ad0221540ef618e21c34aea14e917ed845ec4a /tests
parentaa768574620c46b1ecc4c63f202a4fdb24c4b3f1 (diff)
downloadNim-55a3b51e40a7d3301a114a66712c5daebae0ac6d.tar.gz
fix complex typdesc iterators
Diffstat (limited to 'tests')
-rw-r--r--tests/iter/titertypedesc.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/iter/titertypedesc.nim b/tests/iter/titertypedesc.nim
new file mode 100644
index 000000000..a69f703c6
--- /dev/null
+++ b/tests/iter/titertypedesc.nim
@@ -0,0 +1,17 @@
+discard """
+  output: '''0
+(id: 0)
+@[]
+[0, 0, 0]'''
+"""
+
+iterator foo*(T: typedesc): T =
+  var x: T
+  yield x
+
+for a in foo(int): echo a
+for b in foo(tuple[id: int]): echo b
+for c in foo(seq[int]): echo c
+
+type Generic[T] = T
+for d in foo(Generic[array[0..2, int]]): echo d