Allow void macro result (#11286)

* allow void macro result
* add test for void macro result type
This commit is contained in:
Arne Döring 2019-05-21 21:31:40 +02:00 • committed by Andreas Rumpf
commit f94ec363ab
25 changed files with 143 additions and 60 deletions

View file

@ -606,11 +606,6 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
if n.sons[genericParamsPos].kind == nkEmpty:
# we have a list of implicit type parameters:
n.sons[genericParamsPos] = gp
# no explicit return type? -> use tyTyped
if n.sons[paramsPos].sons[0].kind == nkEmpty:
# use ``stmt`` as implicit result type
s.typ.sons[0] = newTypeS(tyTyped, c)
s.typ.n.sons[0] = newNodeIT(nkType, n.info, s.typ.sons[0])
else:
s.typ = newTypeS(tyProc, c)
# XXX why do we need tyTyped as a return type again?