summary refs log tree commit diff stats
path: root/tests/async/tdiscardableproc.nim
diff options
context:
space:
mode:
authorhlaaftana <10591326+hlaaftana@users.noreply.github.com>2020-05-01 10:49:13 +0300
committerGitHub <noreply@github.com>2020-05-01 09:49:13 +0200
commit9b01c6cf48de5bac8abd32f0327c729d177be653 (patch)
treef153d8fca13d010434d5f0f00a750b4ed46c6f07 /tests/async/tdiscardableproc.nim
parentd5fc35c968c49c6f5529624108ed327095a548c4 (diff)
downloadNim-9b01c6cf48de5bac8abd32f0327c729d177be653.tar.gz
discardable async procs are now an error (#14176)
* add discard warning in manual
Diffstat (limited to 'tests/async/tdiscardableproc.nim')
-rw-r--r--tests/async/tdiscardableproc.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/async/tdiscardableproc.nim b/tests/async/tdiscardableproc.nim
new file mode 100644
index 000000000..80286ece0
--- /dev/null
+++ b/tests/async/tdiscardableproc.nim
@@ -0,0 +1,9 @@
+discard """
+  errmsg: "Cannot make async proc discardable. Futures have to be checked with `asyncCheck` instead of discarded"
+"""
+
+import async
+
+proc foo {.async, discardable.} = discard
+
+foo()