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: static:
error "await expects Future[T], got " & $typeof(f) 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 var internalTmpFuture: FutureBase = f
yield internalTmpFuture yield internalTmpFuture
(cast[type(f)](internalTmpFuture)).read() (cast[type(f)](internalTmpFuture)).read()