next steps for first class iterators
This commit is contained in:
parent
538699a281
commit
dd9ad9e497
7 changed files with 16 additions and 7 deletions
|
|
@ -888,7 +888,13 @@ proc evalIsOp*(n: PNode): PNode =
|
|||
of "closure":
|
||||
let t = skipTypes(t1, abstractRange)
|
||||
result = newIntNode(nkIntLit, ord(t.kind == tyProc and
|
||||
t.callConv == ccClosure))
|
||||
t.callConv == ccClosure and
|
||||
tfIterator notin t.flags))
|
||||
of "iterator":
|
||||
let t = skipTypes(t1, abstractRange)
|
||||
result = newIntNode(nkIntLit, ord(t.kind == tyProc and
|
||||
t.callConv == ccClosure and
|
||||
tfIterator in t.flags))
|
||||
else:
|
||||
let t2 = n[2].typ
|
||||
var match = if t2.kind == tyTypeClass: matchTypeClass(t2, t1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue