unique_name sheningans
This commit is contained in:
@@ -53,14 +53,14 @@ Ast *ast_copy(Ast *ast, Ast_Scope *parent_scope, Array<Ast_Decl *> *replace, Arr
|
||||
Ast_Atom *src = (Ast_Atom *)ast;
|
||||
Ast_Atom *dst = ast_create_copy(parent_scope, Ast_Atom, ast);
|
||||
|
||||
if (replace && with && (dst->flags & AST_TYPESPEC)) {
|
||||
if (replace && with) {
|
||||
// @todo: IF ITS STRUCT we only want to replace TYPESPECS
|
||||
For(*replace) {
|
||||
assert(it->type == pctx->type_type);
|
||||
if (it->name == dst->intern_val) {
|
||||
int it_index = replace->get_index(&it);
|
||||
Ast_Call_Item *replacement = with[0][it_index];
|
||||
Ast *replacement_v = replacement->item;
|
||||
// assert(replacement_v->resolved_type == pctx->type_type);
|
||||
dst = (Ast_Atom *)ast_copy(replacement_v, parent_scope, 0, 0);
|
||||
}
|
||||
}
|
||||
@@ -316,8 +316,7 @@ Ast_Decl *get_or_instantiate_polymorph_type(Token *pos, Ast_Decl *poly, Array<As
|
||||
result->polymorph_hash = hash;
|
||||
|
||||
assert(result->di != poly->di);
|
||||
result->name = get_unique_name_for_decl(result);
|
||||
result->unique_name = result->name;
|
||||
result->unique_name = get_unique_name_for_decl(result);
|
||||
|
||||
poly->polymorphs.allocator = pctx->heap;
|
||||
poly->polymorphs.add(result);
|
||||
@@ -366,8 +365,7 @@ Ast_Decl *get_or_instantiate_polymorph_lambda(Token *pos, Ast_Decl *poly, Array<
|
||||
result->polymorph_hash = hash;
|
||||
|
||||
assert(result->di != poly->di);
|
||||
result->name = get_unique_name_for_decl(result);
|
||||
result->unique_name = result->name;
|
||||
result->unique_name = get_unique_name_for_decl(result);
|
||||
|
||||
poly->polymorphs.allocator = pctx->heap;
|
||||
poly->polymorphs.add(result);
|
||||
|
||||
Reference in New Issue
Block a user