added system.finished for first class iterators

This commit is contained in:
Araq 2012-11-17 01:25:32 +01:00
commit 7f6633a06f
8 changed files with 55 additions and 12 deletions

View file

@ -1173,6 +1173,8 @@ proc SemYield(c: PContext, n: PNode): PNode =
SemYieldVarResult(c, n, restype)
else:
localError(n.info, errCannotReturnExpr)
elif c.p.owner.typ.sons[0] != nil:
localError(n.info, errGenerated, "yield statement must yield a value")
proc lookUpForDefined(c: PContext, i: PIdent, onlyCurrentScope: bool): PSym =
if onlyCurrentScope: