implemented generic templates
This commit is contained in:
parent
08d0003ed0
commit
6bcdb9c8f4
7 changed files with 47 additions and 26 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue