mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
Merge pull request #680 from Varriount/core/fix-generic-crashes
Prevent lambdas from crashing if given implicit generic parameters.
This commit is contained in:
@@ -883,8 +883,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)
|
||||
|
||||
Reference in New Issue
Block a user