Remove decls from lambda scope after resolution
This commit is contained in:
@@ -474,11 +474,6 @@ void list_free_node(List<T> *list, List_Node<T> *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>
|
||||
int length(List<T> *list) {
|
||||
int result = 0;
|
||||
|
||||
@@ -938,6 +938,7 @@ try_resolving_lambda_scope(Operand *op, Ast_Lambda *lambda, Ast_Type *lambda_typ
|
||||
}
|
||||
|
||||
*op = operand_lambda(lambda_type);
|
||||
free_all_nodes(&lambda->scope->decls);
|
||||
}
|
||||
else if (is_flag_set(lambda->flags, AST_FOREIGN)) {
|
||||
*op = operand_lambda(lambda_type);
|
||||
@@ -1709,11 +1710,11 @@ resolve_decl(Ast_Decl *ast) {
|
||||
|
||||
node->unique_name = node->name;
|
||||
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)) {
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user