mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-24 00:05:25 +00:00
more modules compile again
This commit is contained in:
@@ -17,21 +17,21 @@ proc iterToProcImpl(c: PContext, n: PNode): PNode =
|
||||
result = newNodeI(nkStmtList, n.info)
|
||||
let iter = n[1]
|
||||
if iter.kind != nkSym or iter.sym.kind != skIterator:
|
||||
localError(iter.info, "first argument needs to be an iterator")
|
||||
localError(c.config, iter.info, "first argument needs to be an iterator")
|
||||
return
|
||||
if n[2].typ.isNil:
|
||||
localError(n[2].info, "second argument needs to be a type")
|
||||
localError(c.config, n[2].info, "second argument needs to be a type")
|
||||
return
|
||||
if n[3].kind != nkIdent:
|
||||
localError(n[3].info, "third argument needs to be an identifier")
|
||||
localError(c.config, n[3].info, "third argument needs to be an identifier")
|
||||
return
|
||||
|
||||
let t = n[2].typ.skipTypes({tyTypeDesc, tyGenericInst})
|
||||
if t.kind notin {tyRef, tyPtr} or t.lastSon.kind != tyObject:
|
||||
localError(n[2].info,
|
||||
localError(c.config, n[2].info,
|
||||
"type must be a non-generic ref|ptr to object with state field")
|
||||
return
|
||||
let body = liftIterToProc(iter.sym, iter.sym.getBody, t)
|
||||
let body = liftIterToProc(c.graph, iter.sym, iter.sym.getBody, t)
|
||||
|
||||
let prc = newSym(skProc, n[3].ident, iter.sym.owner, iter.sym.info)
|
||||
prc.typ = copyType(iter.sym.typ, prc, false)
|
||||
|
||||
Reference in New Issue
Block a user