This commit is contained in:
Araq
2013-05-04 02:22:38 +02:00
parent 0991706d55
commit 3aa36a8568
4 changed files with 19 additions and 3 deletions

View File

@@ -1146,6 +1146,12 @@ proc semProcBody(c: PContext, n: PNode): PNode =
# discard it. This is bad for chaining but nicer for C wrappers.
# ambiguous :-(
result.typ = nil
elif result.kind == nkStmtListExpr and result.typ.kind == tyNil:
# to keep backwards compatibility bodies like:
# nil
# # comment
# are not expressions:
fixNilType(result)
else:
var a = newNodeI(nkAsgn, n.info, 2)
a.sons[0] = newSymNode(c.p.resultSym)