mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
discardable async procs are now an error (#14176)
* add discard warning in manual
This commit is contained in:
@@ -2568,7 +2568,8 @@ Example:
|
||||
discard p(3, 4) # discard the return value of `p`
|
||||
|
||||
The ``discard`` statement evaluates its expression for side-effects and
|
||||
throws the expression's resulting value away.
|
||||
throws the expression's resulting value away, and should only be used
|
||||
when ignoring this value is known not to cause problems.
|
||||
|
||||
Ignoring the return value of a procedure without using a discard statement is
|
||||
a static error.
|
||||
|
||||
Reference in New Issue
Block a user