diff options
Diffstat (limited to 'compiler/seminst.nim')
-rwxr-xr-x | compiler/seminst.nim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim index a03f62075..ffda48fba 100755 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -74,7 +74,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}: + if result.kind in {skProc, skMethod, skConverter, skMacro}: addResult(c, result.typ.sons[0], n.info, result.kind) addResultNode(c, n) var b = semStmtScope(c, n.sons[bodyPos]) @@ -184,8 +184,9 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, pragma(c, result, n.sons[pragmasPos], allRoutinePragmas) if isNil(n.sons[bodyPos]): n.sons[bodyPos] = copyTree(fn.getBody) - instantiateBody(c, n, result) - sideEffectsCheck(c, result) + if fn.kind != skTemplate: + instantiateBody(c, n, result) + sideEffectsCheck(c, result) else: result = oldPrc popInfoContext() |