From 5150186c68af1fbcc1185d815f52024c4647fe0b Mon Sep 17 00:00:00 2001 From: Danil Yarantsev Date: Sun, 31 May 2020 13:43:27 +0300 Subject: Disable unused warnings for await in async macro (#14517) * Disable unused warnings for await in async macro * Remove used for the error template --- lib/pure/asyncmacro.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/pure/asyncmacro.nim') diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index afc28bbdf..77db80bc6 100644 --- a/lib/pure/asyncmacro.nim +++ b/lib/pure/asyncmacro.nim @@ -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.}" \ No newline at end of file + # error "await only available within {.async.}" -- cgit 1.4.1-2-gfad0