Prevent lambdas from crashing if given implicit generic parameters.

This commit is contained in:
Clay Sweetser 2013-11-14 12:32:35 -05:00
commit d77370694c

View file

@ -880,7 +880,8 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode =
if n.sons[genericParamsPos].kind != nkEmpty:
illFormedAst(n) # process parameters:
if n.sons[paramsPos].kind != nkEmpty:
semParamList(c, n.sons[ParamsPos], nil, s)
var gp = newNodeI(nkGenericParams, n.info)
semParamList(c, n.sons[ParamsPos], gp, s)
ParamsTypeCheck(c, s.typ)
else:
s.typ = newTypeS(tyProc, c)