fix complex typdesc iterators

This commit is contained in:
Jasper Jenkins 2019-05-08 14:29:42 -07:00
commit 55a3b51e40
2 changed files with 18 additions and 0 deletions

View file

@ -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