summary refs log tree commit diff stats
path: root/tests/effects/tgcsafe2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/effects/tgcsafe2.nim')
-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")