diff --git a/src/parse.c b/src/parse.c index 14aae78..36b8ddb 100644 --- a/src/parse.c +++ b/src/parse.c @@ -202,7 +202,6 @@ AST *nct_parse_expression(Parser *P, int lOP) { P->isInFunction++; e->chunk = (AST*) nct_parse_chunk(P, 1, 0, scope_new(P->scope), ft); - e->chunk->chunk.functionType = ft; P->isInFunction--; @@ -1642,6 +1641,8 @@ ASTChunk *nct_parse_chunk(Parser *P, int isTopLevel, int varPrioritize, Scope *t /* Arguments */ if(ft && isTopLevel) { + P->topLevel->functionType = ft; + ScopeItem **vtes = alloca(sizeof(*vtes) * ft->function.argCount); // First arguments in a function TLC is the arguments