diff options
Diffstat (limited to 'compiler/seminst.nim')
-rw-r--r-- | compiler/seminst.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim index f9d7c3754..4bf1e6ef2 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -326,7 +326,8 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, # no need to instantiate generic templates/macros: internalAssert c.config, fn.kind notin {skMacro, skTemplate} # generates an instantiated proc - if c.instCounter > 1000: internalError(c.config, fn.ast.info, "nesting too deep") + if c.instCounter > 50: + globalError(c.config, info, "generic instantiation too nested") inc(c.instCounter) # careful! we copy the whole AST including the possibly nil body! var n = copyTree(fn.ast) |