diff options
author | Araq <rumpf_a@web.de> | 2017-11-03 18:05:14 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-11-03 18:05:14 +0100 |
commit | 8cc268876a214d164899b0d0a0ccdcb98a861b1b (patch) | |
tree | de912897393c5ba5ddadf61c6dc2376415cd171e /tests/closure | |
parent | 0f5261e9711c3fd57241874963bd5e45b11ed65e (diff) | |
download | Nim-8cc268876a214d164899b0d0a0ccdcb98a861b1b.tar.gz |
bugfix: detect captures in non-closure inner procs
Diffstat (limited to 'tests/closure')
-rw-r--r-- | tests/closure/tinvalidclosure3.nim | 12 |
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 |