summary refs log tree commit diff stats
path: root/tests/ccgbugs/tcapture_static.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-08-09 14:16:13 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-08-09 14:16:26 +0200
commit440ed8eb68e3b602f6330d7aa54cff4447d0f0bf (patch)
tree6a17527822b6ec9daa87b41211cf818740833adf /tests/ccgbugs/tcapture_static.nim
parentf1092512e3c9c0c4b9c744fcef49db6b9c5a5623 (diff)
downloadNim-440ed8eb68e3b602f6330d7aa54cff4447d0f0bf.tar.gz
fixes #4551
Diffstat (limited to 'tests/ccgbugs/tcapture_static.nim')
-rw-r--r--tests/ccgbugs/tcapture_static.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ccgbugs/tcapture_static.nim b/tests/ccgbugs/tcapture_static.nim
new file mode 100644
index 000000000..2afb8de47
--- /dev/null
+++ b/tests/ccgbugs/tcapture_static.nim
@@ -0,0 +1,13 @@
+discard """
+  output: '''hi'''
+"""
+
+# bug #4551
+
+proc foo() =
+    let arr = ["hi"]
+    for i, v in arr:
+        let bar = proc =
+            echo v
+        bar()
+foo()