Fix generic forward declarations; fixes #4104; fixes #4908 (#5566)

This commit is contained in:
zah 2017-03-23 13:40:57 +02:00 • committed by Andreas Rumpf
commit be174fc3c7
5 changed files with 36 additions and 15 deletions

View file

@ -1433,7 +1433,6 @@ proc semReturn(c: PContext, n: PNode): PNode =
proc semProcBody(c: PContext, n: PNode): PNode =
openScope(c)
result = semExpr(c, n)
if c.p.resultSym != nil and not isEmptyType(result.typ):
# transform ``expr`` to ``result = expr``, but not if the expr is already