summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorClay Sweetser <clay.sweetser@gmail.com>2013-11-14 12:32:35 -0500
committerClay Sweetser <clay.sweetser@gmail.com>2013-11-14 12:32:35 -0500
commitd77370694c213e6a5fd13421fabc2d201bf0c22d (patch)
treede17faf26f05507df1886611cebeb4eb132e4a38 /compiler
parent9061b8961eb5cefd31eba9314a5932f35f524eac (diff)
downloadNim-d77370694c213e6a5fd13421fabc2d201bf0c22d.tar.gz
Prevent lambdas from crashing if given implicit generic parameters.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index ed6787a16..3752739bf 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -879,8 +879,9 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode =
   openScope(c)
   if n.sons[genericParamsPos].kind != nkEmpty:
     illFormedAst(n)           # process parameters:
-  if n.sons[paramsPos].kind != nkEmpty: 
-    semParamList(c, n.sons[ParamsPos], nil, s)
+  if n.sons[paramsPos].kind != nkEmpty:
+    var gp = newNodeI(nkGenericParams, n.info)
+    semParamList(c, n.sons[ParamsPos], gp, s)
     ParamsTypeCheck(c, s.typ)
   else:
     s.typ = newTypeS(tyProc, c)