summary refs log tree commit diff stats
path: root/tests/closure
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-11-03 18:05:14 +0100
committerAraq <rumpf_a@web.de>2017-11-03 18:05:14 +0100
commit8cc268876a214d164899b0d0a0ccdcb98a861b1b (patch)
treede912897393c5ba5ddadf61c6dc2376415cd171e /tests/closure
parent0f5261e9711c3fd57241874963bd5e45b11ed65e (diff)
downloadNim-8cc268876a214d164899b0d0a0ccdcb98a861b1b.tar.gz
bugfix: detect captures in non-closure inner procs
Diffstat (limited to 'tests/closure')
-rw-r--r--tests/closure/tinvalidclosure3.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/closure/tinvalidclosure3.nim b/tests/closure/tinvalidclosure3.nim
new file mode 100644
index 000000000..31c4976f8
--- /dev/null
+++ b/tests/closure/tinvalidclosure3.nim
@@ -0,0 +1,12 @@
+discard """
+  line: 9
+  errormsg: "illegal capture 'x'"
+"""
+
+proc outer(arg: string) =
+  var x = 0
+  proc inner {.inline.} =
+    echo "inner", x
+  inner()
+
+outer("abc")
\ No newline at end of file