From 9e88425d7c5e3edfcbddedbe062c5f028789a002 Mon Sep 17 00:00:00 2001 From: Ardek Romak Date: Tue, 30 Mar 2021 09:07:45 +0300 Subject: Fix void async in templates (#17562) * Fix https://github.com/nim-lang/Nim/issues/16159 * Add test for async in template * Shorten the expression * Even shorter Co-authored-by: Clyybber --- lib/pure/asyncmacro.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index eecec4278..336d10aad 100644 --- a/lib/pure/asyncmacro.nim +++ b/lib/pure/asyncmacro.nim @@ -184,8 +184,9 @@ proc asyncSingleProc(prc: NimNode): NimNode = verifyReturnType(repr(returnType), returnType) let subtypeIsVoid = returnType.kind == nnkEmpty or - (baseType.kind == nnkIdent and returnType[1].eqIdent("void")) - + (baseType.kind in {nnkIdent, nnkSym} and + baseType.eqIdent("void")) + let futureVarIdents = getFutureVarIdents(prc.params) var outerProcBody = newNimNode(nnkStmtList, prc.body) -- cgit 1.4.1-2-gfad0 simple, vim-like file managerakspecs <akspecs@tilde.institute>
summary refs log tree commit diff stats