added system.finished for first class iterators
This commit is contained in:
parent
7a2c11d3cf
commit
7f6633a06f
8 changed files with 55 additions and 12 deletions
|
|
@ -818,7 +818,7 @@ proc semIterator(c: PContext, n: PNode): PNode =
|
|||
result = semProcAux(c, n, skIterator, iteratorPragmas)
|
||||
var s = result.sons[namePos].sym
|
||||
var t = s.typ
|
||||
if t.sons[0] == nil:
|
||||
if t.sons[0] == nil and s.typ.callConv != ccClosure:
|
||||
LocalError(n.info, errXNeedsReturnType, "iterator")
|
||||
# iterators are either 'inline' or 'closure'; for backwards compatibility,
|
||||
# we require first class iterators to be marked with 'closure' explicitly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue