summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2021-01-08 07:42:38 -0600
committerGitHub <noreply@github.com>2021-01-08 14:42:38 +0100
commit38b8d080f29021d2685e09d552c2a7753ef25484 (patch)
treedd243384bcfaf709c837c1d9b033f2f43efd75ea /tests
parentadd1ccb6cb4ad4b444a5cfa3ef5573b0c1d47d09 (diff)
downloadNim-38b8d080f29021d2685e09d552c2a7753ef25484.tar.gz
close #1550 add testcase (#16640)
Diffstat (limited to 'tests')
-rw-r--r--tests/iter/t1550.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/iter/t1550.nim b/tests/iter/t1550.nim
new file mode 100644
index 000000000..8ad96f0da
--- /dev/null
+++ b/tests/iter/t1550.nim
@@ -0,0 +1,20 @@
+type
+  A[T] = iterator(x: T): T {.gcsafe, closure.}
+
+iterator aimp[T](x: T): T {.gcsafe, closure.} =
+  var total = 0
+  while (total < 100):
+    yield total
+    total += x
+
+iterator bimp(y: A[int], z:int): int {.gcsafe, closure.} =
+  for i in y(z):
+    yield i
+
+for x in aimp[int](3):
+  discard x
+
+var y = aimp[int]
+var z = bimp
+for x in z(y, 1):
+  discard x
\ No newline at end of file