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:
Danil Yarantsev 2020-05-31 13:43:27 +03:00 • committed by GitHub
commit 5150186c68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.}"