store the instantiation cache in the generic symbol

This commit is contained in:
Zahary Karadjov 2012-11-20 23:38:56 +02:00
commit e6f3f46cd9
7 changed files with 95 additions and 71 deletions

View file

@ -190,7 +190,7 @@ include semtypes, semtempl, semgnrc, semstmts, semexprs
proc addCodeForGenerics(c: PContext, n: PNode) =
for i in countup(c.generics.lastGenericIdx, Len(c.generics.generics) - 1):
var prc = c.generics.generics[i].instSym
var prc = c.generics.generics[i].inst.sym
if prc.kind in {skProc, skMethod, skConverter} and prc.magic == mNone:
if prc.ast == nil or prc.ast.sons[bodyPos] == nil:
InternalError(prc.info, "no code for " & prc.name.s)