summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-07-01 22:58:44 +0200
committerAraq <rumpf_a@web.de>2014-07-01 22:58:44 +0200
commitb56f43c394a03bac441058be9d0754324352593d (patch)
tree32e1185a94d264ae461281cdced1a388b0d230e6 /compiler
parentb3f390bd481a4e4a3f56d8a689450392fa408779 (diff)
downloadNim-b56f43c394a03bac441058be9d0754324352593d.tar.gz
fixes #898
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ast.nim2
-rw-r--r--compiler/semtypes.nim8
2 files changed, 8 insertions, 2 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 7ff22e184..516954b88 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -1048,7 +1048,7 @@ proc discardSons(father: PNode) =
   father.sons = nil
 
 when defined(useNodeIds):
-  const nodeIdToDebug* = 482228 # 612794
+  const nodeIdToDebug* = 310841 # 612794
   #612840 # 612905 # 614635 # 614637 # 614641
   # 423408
   #429107 # 430443 # 441048 # 441090 # 441153
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 0ecdeb529..b075e603d 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -864,7 +864,13 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
   var counter = 0
   for i in countup(1, n.len - 1):
     var a = n.sons[i]
-    if a.kind != nkIdentDefs: illFormedAst(a)
+    if a.kind != nkIdentDefs:
+      # for some generic instantiations the passed ':env' parameter
+      # for closures has already been produced (see bug #898). We simply
+      # skip this parameter here. It'll then be re-generated in another LL
+      # pass over this instantiation:
+      if a.kind == nkSym and sfFromGeneric in a.sym.flags: continue
+      illFormedAst(a)
     checkMinSonsLen(a, 3)
     var
       typ: PType = nil