summary refs log tree commit diff stats
path: root/compiler/seminst.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-01-27 23:41:45 +0200
committerZahary Karadjov <zahary@gmail.com>2013-01-27 23:41:45 +0200
commit81a3585872b1a327b62ba528addbee913d6bbe5a (patch)
treeaff8358bc86704edbd89fd56ec4f7b0cd3583bca /compiler/seminst.nim
parent67f37264b3f461fe46f5cfea7c35c0a4f709dcb0 (diff)
parent07585088955c1fe8fb815c40409ed9f5d66fd446 (diff)
downloadNim-81a3585872b1a327b62ba528addbee913d6bbe5a.tar.gz
merged upstream master
Diffstat (limited to 'compiler/seminst.nim')
-rwxr-xr-xcompiler/seminst.nim6
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