From 07e3604a8c2a968ae0eee2b1a7397af74fcf8d5b Mon Sep 17 00:00:00 2001 From: Mid <> Date: Thu, 2 Oct 2025 13:39:11 +0300 Subject: [PATCH] Set TLC functionType sooner --- src/parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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