This commit is contained in:
Araq 2015-07-05 14:02:51 +02:00
commit 36ca2f1102

View file

@ -1369,7 +1369,7 @@ proc semProcBody(c: PContext, n: PNode): PNode =
c.p.resultSym != nil and c.p.resultSym.typ.isMetaType: c.p.resultSym != nil and c.p.resultSym.typ.isMetaType:
if isEmptyType(result.typ): if isEmptyType(result.typ):
# we inferred a 'void' return type: # we inferred a 'void' return type:
c.p.resultSym.typ = nil c.p.resultSym.typ = errorType(c)
c.p.owner.typ.sons[0] = nil c.p.owner.typ.sons[0] = nil
else: else:
localError(c.p.resultSym.info, errCannotInferReturnType) localError(c.p.resultSym.info, errCannotInferReturnType)