Implicitly cast return type

This commit is contained in:
Mid 2025-10-02 13:44:35 +03:00
parent d46b104d5c
commit 2188448b19

View File

@ -1166,7 +1166,7 @@ static void nct_parse_statement(Parser *P) {
ret->next = NULL;
if(!maybe(P, TOKEN_SEMICOLON)) {
ret->val = nct_parse_expression(P, 0);
ret->val = ast_cast_expr(nct_parse_expression(P, 0), P->topLevel->functionType->function.ret);
expect(P, TOKEN_SEMICOLON);
}