summary refs log tree commit diff stats
path: root/tests/effects
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-10-14 22:12:23 +0200
committerAraq <rumpf_a@web.de>2017-10-14 22:35:20 +0200
commit9af94803404963ad7cb5969c8321ec0a526939d8 (patch)
tree9181b4cbf705c8eb5b20c8c6d88c592f1f70063f /tests/effects
parent5768eaa2fdc92ffbb1ba767a09da8bef3968c40e (diff)
downloadNim-9af94803404963ad7cb5969c8321ec0a526939d8.tar.gz
fixes #5620
Diffstat (limited to 'tests/effects')
-rw-r--r--tests/effects/tgcsafe2.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/effects/tgcsafe2.nim b/tests/effects/tgcsafe2.nim
new file mode 100644
index 000000000..dbc4540c4
--- /dev/null
+++ b/tests/effects/tgcsafe2.nim
@@ -0,0 +1,12 @@
+discard """
+  errormsg: ''' (proc (s: string) = res &= &(s, "abc"), nil) is not GC safe'''
+  line: 11
+"""
+#5620
+var res = ""
+
+proc takeCallback(foo: (proc(s: string) {.gcsafe.})) =
+  foo "string"
+
+takeCallback(proc (s: string) =
+  res &= s & "abc")