diff options
author | Araq <rumpf_a@web.de> | 2012-08-27 01:59:14 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-08-27 01:59:14 +0200 |
commit | 6bcdb9c8f429b48e534c50d3dadf7b31783aa0bf (patch) | |
tree | 1da66a9598848658f8efd440de349fb3677400d9 /compiler/seminst.nim | |
parent | 08d0003ed0cd4493df2486e6a1c62d7b547c735f (diff) | |
download | Nim-6bcdb9c8f429b48e534c50d3dadf7b31783aa0bf.tar.gz |
implemented generic templates
Diffstat (limited to 'compiler/seminst.nim')
-rwxr-xr-x | compiler/seminst.nim | 5 |
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) |