summary refs log tree commit diff stats
path: root/tests/iter
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2020-04-07 14:42:59 +0200
committerGitHub <noreply@github.com>2020-04-07 14:42:59 +0200
commit37692baf49370d096e0d9ac2c8bf51ed7bd8cf8a (patch)
tree7ad23f49b978318539fad98f0f96e54cbe833568 /tests/iter
parent92c4aad2059a350e95bc7a64932873b41b085976 (diff)
downloadNim-37692baf49370d096e0d9ac2c8bf51ed7bd8cf8a.tar.gz
fix #13739 (#13742)
Diffstat (limited to 'tests/iter')
-rw-r--r--tests/iter/titer_issues.nim27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/iter/titer_issues.nim b/tests/iter/titer_issues.nim
index a7830dfab..872ebe2b7 100644
--- a/tests/iter/titer_issues.nim
+++ b/tests/iter/titer_issues.nim
@@ -18,6 +18,15 @@ end
 1
 2
 7
+9002
+9004
+9006
+9008
+9010
+9012
+9014
+9016
+9018
 '''
 """
 
@@ -213,3 +222,21 @@ block t2023_objiter:
 
   var o = init()
   echo(o.iter())
+
+
+block:
+  # issue #13739
+  iterator myIter(arg: openarray[int]): int =
+    var tmp = 0
+    let len = arg.len
+    while tmp < len:
+      yield arg[tmp] * 2
+      inc tmp
+
+  proc someProc() =
+    var data = [4501,4502,4503,4504,4505,4506,4507,4508,4509]
+    # StmtListExpr should not get special treatment.
+    for x in myIter((discard;data)):
+      echo x
+
+  someProc()