summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-10-30 22:53:45 +0800
committerGitHub <noreply@github.com>2020-10-30 15:53:45 +0100
commitae86df12af6c00ea74659375b758178cc2d73311 (patch)
tree684c4b8b9e99493419c8cd171f2e87d6de239962 /tests
parent2cfe5e0745cf33ed5698378dd16e01ce542f05e5 (diff)
downloadNim-ae86df12af6c00ea74659375b758178cc2d73311.tar.gz
add testcase for #14227 (#15794)
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/t14227.nim23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/macros/t14227.nim b/tests/macros/t14227.nim
new file mode 100644
index 000000000..4206e2c06
--- /dev/null
+++ b/tests/macros/t14227.nim
@@ -0,0 +1,23 @@
+discard """
+  action: "compile"
+"""
+import sugar
+
+
+block:
+  let y = @[@[1, 2], @[2, 4, 6]]
+  let x = collect(newSeq):
+    for i in y:
+      if i.len > 2:
+        for j in i:
+          j
+  echo(x)
+
+block:
+  let y = @[@[1, 2], @[2, 4, 6]]
+  let x = collect(newSeq):
+    for i in y:
+      for j in i:
+        if i.len > 2:
+          j
+  echo(x)