Disable unused warnings for await in async macro (#14517)
* Disable unused warnings for await in async macro * Remove used for the error template
This commit is contained in:
parent
177c7f96e9
commit
5150186c68
1 changed files with 2 additions and 2 deletions
|
|
@ -267,7 +267,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
|
|||
static:
|
||||
error "await expects Future[T], got " & $typeof(f)
|
||||
|
||||
template await[T](f: Future[T]): auto =
|
||||
template await[T](f: Future[T]): auto {.used.} =
|
||||
var internalTmpFuture: FutureBase = f
|
||||
yield internalTmpFuture
|
||||
(cast[type(f)](internalTmpFuture)).read()
|
||||
|
|
@ -355,4 +355,4 @@ macro multisync*(prc: untyped): untyped =
|
|||
# overload for await as a fallback handler, based on the yglukhov's patch to chronos: https://github.com/status-im/nim-chronos/pull/47
|
||||
# template await*(f: typed): untyped =
|
||||
# static:
|
||||
# error "await only available within {.async.}"
|
||||
# error "await only available within {.async.}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue