summary refs log tree commit diff stats
path: root/compiler/seminst.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/seminst.nim')
-rwxr-xr-xcompiler/seminst.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim
index 8e4cb086d..2d1f68d5d 100755
--- a/compiler/seminst.nim
+++ b/compiler/seminst.nim
@@ -133,7 +133,10 @@ proc applyConcreteTypesToSig(genericProc: PSym, concTypes: seq[PType]): PType =
       if i > 0: result.n.sons[i] = sig.n.sons[i]
 
 proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, 
-                      info: TLineInfo): PSym = 
+                      info: TLineInfo): PSym =
+  # no need to instantiate generic templates/macros:
+  if fn.kind in {skTemplate, skMacro}: return fn
+  
   # generates an instantiated proc
   if c.InstCounter > 1000: InternalError(fn.ast.info, "nesting too deep")
   inc(c.InstCounter)