From 6bcdb9c8f429b48e534c50d3dadf7b31783aa0bf Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 27 Aug 2012 01:59:14 +0200 Subject: implemented generic templates --- compiler/seminst.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/seminst.nim') 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) -- cgit 1.4.1-2-gfad0