Recursive lambdas with new system
This commit is contained in:
@@ -334,6 +334,10 @@ eval_expr(Ast_Expr *ast, Ast_Resolved_Type *expected_type, Sym *lambda_to_comple
|
||||
assert(lambda_type);
|
||||
Value val; val.type_val = lambda_type;
|
||||
sym_new_resolved(SYM_CONST, {}, type_type, val, node);
|
||||
if(lambda_to_complete){
|
||||
lambda_to_complete->type = lambda_type;
|
||||
lambda_to_complete->state = SYM_RESOLVED;
|
||||
}
|
||||
}
|
||||
|
||||
Operand result = {type_type, true};
|
||||
@@ -533,14 +537,6 @@ resolve_sym(Sym *sym){
|
||||
assert(sym->ast->kind == AST_VAR || sym->ast->kind == AST_CONST);
|
||||
sym->state = SYM_RESOLVING;
|
||||
|
||||
// @note: lambda doesn't need body for it to be usable
|
||||
// quickly resolve the type so we can have recursive functions
|
||||
// Ast_Lambda *lambda = ast_get_lambda(sym->ast);
|
||||
// if(lambda){
|
||||
// sym->type = eval_typespec(ast_typespec_lambda(lambda->pos, lambda));
|
||||
// sym->state = SYM_RESOLVED;
|
||||
// }
|
||||
|
||||
Operand op = eval_decl(sym->ast, sym);
|
||||
sym->type = op.type;
|
||||
if(sym->kind == SYM_CONST){
|
||||
|
||||
Reference in New Issue
Block a user