Remove decls from lambda scope after resolution

This commit is contained in:
Krzosa Karol
2023-03-31 17:42:19 +02:00
parent b2e8012afa
commit 0e01b785f1
2 changed files with 3 additions and 7 deletions

View File

@@ -474,11 +474,6 @@ void list_free_node(List<T> *list, List_Node<T> *node) {
DLL_STACK_ADD(list->first_free, node); DLL_STACK_ADD(list->first_free, node);
} }
template <class T>
void clear(List<T> *list) {
memory_zero(list, sizeof(List<T>));
}
template <class T> template <class T>
int length(List<T> *list) { int length(List<T> *list) {
int result = 0; int result = 0;

View File

@@ -938,6 +938,7 @@ try_resolving_lambda_scope(Operand *op, Ast_Lambda *lambda, Ast_Type *lambda_typ
} }
*op = operand_lambda(lambda_type); *op = operand_lambda(lambda_type);
free_all_nodes(&lambda->scope->decls);
} }
else if (is_flag_set(lambda->flags, AST_FOREIGN)) { else if (is_flag_set(lambda->flags, AST_FOREIGN)) {
*op = operand_lambda(lambda_type); *op = operand_lambda(lambda_type);
@@ -1709,11 +1710,11 @@ resolve_decl(Ast_Decl *ast) {
node->unique_name = node->name; node->unique_name = node->name;
if (!is_flag_set(node->expr->flags, AST_FOREIGN)) { if (!is_flag_set(node->expr->flags, AST_FOREIGN)) {
node->unique_name = pctx->intern(string_fmt(scratch.arena, "%Q%Q%d", pctx->symbol_prefix, node->name, pctx->lambda_ids++)); node->unique_name = pctx->internf("%Q%Q%d", pctx->symbol_prefix, node->name, pctx->lambda_ids++);
} }
if (is_flag_set(node->flags, AST_OPERATOR_OVERLOAD)) { if (is_flag_set(node->flags, AST_OPERATOR_OVERLOAD)) {
node->unique_name = pctx->intern(string_fmt(scratch.arena, "%QOPERATOR_%Q%d", pctx->symbol_prefix, node->overload_op_info->name, pctx->lambda_ids++)); node->unique_name = pctx->internf("%QOPERATOR_%Q%d", pctx->symbol_prefix, node->overload_op_info->name, pctx->lambda_ids++);
} }
BREAK(); BREAK();