fix #715 again
the regression was caused by the introduction of "generic" lambdas
This commit is contained in:
parent
7080d02af4
commit
cf8fe16a48
6 changed files with 29 additions and 4 deletions
|
|
@ -21,7 +21,7 @@ proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags = {}): PNode
|
|||
|
||||
proc semOperand(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
||||
# same as 'semExprWithType' but doesn't check for proc vars
|
||||
result = semExpr(c, n, flags)
|
||||
result = semExpr(c, n, flags + {efOperand})
|
||||
if result.kind == nkEmpty:
|
||||
# do not produce another redundant error message:
|
||||
#raiseRecoverableError("")
|
||||
|
|
@ -1218,6 +1218,7 @@ 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
|
||||
|
|
@ -1241,6 +1242,10 @@ proc semProcBody(c: PContext, n: PNode): PNode =
|
|||
result = semAsgn(c, a)
|
||||
else:
|
||||
discardCheck(c, result)
|
||||
|
||||
if c.p.resultSym != nil and c.p.resultSym.typ.isMetaType:
|
||||
localError(c.p.resultSym.info, errCannotInferReturnType)
|
||||
|
||||
closeScope(c)
|
||||
|
||||
proc semYieldVarResult(c: PContext, n: PNode, restype: PType) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue