forked from solstice/solstice
Lambdas now capture state
This commit is contained in:
@@ -734,12 +734,7 @@ ResultType(GroundProgram, charptr) generateLambdaNode(SolsNode* node, SolsScope*
|
||||
groundAddInstructionToProgram(&gp, signature);
|
||||
|
||||
// Create a scope for lambda arguments
|
||||
// Lambdas do NOT have access to external state
|
||||
SolsScope lambdaScope = {
|
||||
.variables = NULL,
|
||||
.tmpCounter = 0,
|
||||
.returnType = *node->as.type.returnType
|
||||
};
|
||||
SolsScope lambdaScope = copySolsScope(scope);
|
||||
|
||||
for (size_t i = 0; i < node->as.type.children.count; i++) {
|
||||
addVariableToScope(&lambdaScope, node->as.type.children.at[i].name, node->as.type.children.at[i].type);
|
||||
|
||||
Reference in New Issue
Block a user