mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 19:02:18 +00:00
discardable async procs are now an error (#14176)
* add discard warning in manual
This commit is contained in:
9
tests/async/tdiscardableproc.nim
Normal file
9
tests/async/tdiscardableproc.nim
Normal file
@@ -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()
|
||||
@@ -26,5 +26,5 @@ proc hop(): bool =
|
||||
|
||||
echo "done"
|
||||
|
||||
const r = hop()
|
||||
const r {.used.} = hop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user