diff options
author | Zahary Karadjov <zahary@gmail.com> | 2013-01-27 23:41:45 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2013-01-27 23:41:45 +0200 |
commit | 81a3585872b1a327b62ba528addbee913d6bbe5a (patch) | |
tree | aff8358bc86704edbd89fd56ec4f7b0cd3583bca /compiler/seminst.nim | |
parent | 67f37264b3f461fe46f5cfea7c35c0a4f709dcb0 (diff) | |
parent | 07585088955c1fe8fb815c40409ed9f5d66fd446 (diff) | |
download | Nim-81a3585872b1a327b62ba528addbee913d6bbe5a.tar.gz |
merged upstream master
Diffstat (limited to 'compiler/seminst.nim')
-rwxr-xr-x | compiler/seminst.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 5a818103d..95a394a09 100755 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -89,9 +89,7 @@ proc instantiateBody(c: PContext, n: PNode, result: PSym) = # add it here, so that recursive generic procs are possible: addDecl(c, result) pushProcCon(c, result) - if result.kind in {skProc, skMethod, skConverter, skMacro}: - addResult(c, result.typ.sons[0], n.info, result.kind) - addResultNode(c, n) + maybeAddResult(c, result, n) var b = n.sons[bodyPos] var symMap: TIdTable InitIdTable symMap @@ -163,6 +161,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, result.typ = newTypeS(tyProc, c) rawAddSon(result.typ, nil) result.typ.callConv = fn.typ.callConv + if result.kind == skIterator: result.typ.flags.incl(tfIterator) var oldPrc = GenericCacheGet(fn, entry[]) if oldPrc == nil: fn.procInstCache.safeAdd(entry) @@ -182,6 +181,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, popOwner() c.friendModule = oldFriend dec(c.InstCounter) + if result.kind == skMethod: finishMethod(c, result) proc instGenericContainer(c: PContext, n: PNode, header: PType): PType = var cl: TReplTypeVars |