summary refs log tree commit diff stats
path: root/compiler/seminst.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-28 11:16:37 +0200
committerAraq <rumpf_a@web.de>2018-08-28 15:41:55 +0200
commit9c3cba1c2285a9d0250ed26f12598770e4ed78f4 (patch)
tree30c755a76f26c1c73f028ca91eaad71123c838f4 /compiler/seminst.nim
parentdc5851e87373203f5c64b9f15872e2865ab85f3f (diff)
downloadNim-9c3cba1c2285a9d0250ed26f12598770e4ed78f4.tar.gz
fixes #4766
Diffstat (limited to 'compiler/seminst.nim')
-rw-r--r--compiler/seminst.nim3
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)