diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index a56df9502..886f9458d 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1369,7 +1369,7 @@ proc semProcBody(c: PContext, n: PNode): PNode = c.p.resultSym != nil and c.p.resultSym.typ.isMetaType: if isEmptyType(result.typ): # we inferred a 'void' return type: - c.p.resultSym.typ = nil + c.p.resultSym.typ = errorType(c) c.p.owner.typ.sons[0] = nil else: localError(c.p.resultSym.info, errCannotInferReturnType)