Polymorphic procedure, with passed in compile time type but without removing the type in params etc.
This commit is contained in:
@@ -306,16 +306,26 @@ Ast_Decl *get_or_instantiate_polymorph_type(Token *pos, Ast_Decl *poly, Array<As
|
||||
}
|
||||
}
|
||||
|
||||
if (poly->kind == AST_LAMBDA) Breakpoint;
|
||||
|
||||
if (!result) {
|
||||
result = (Ast_Decl *)ast_copy(poly, poly->parent_scope, &poly->polymorph_parameters, ¶ms);
|
||||
unset_flag(result->flags, AST_POLYMORPH);
|
||||
result->type_val = type_incomplete(result);
|
||||
unset_flag(result->flags, AST_PARENT_POLYMORPH);
|
||||
if (poly->kind == AST_STRUCT || poly->kind == AST_UNION) result->type_val = type_incomplete(result);
|
||||
result->polymorph_hash = hash;
|
||||
|
||||
assert(result->di != poly->di);
|
||||
result->name = get_unique_name_for_decl(result);
|
||||
|
||||
poly->polymorphs.allocator = pctx->heap;
|
||||
poly->polymorphs.add(result);
|
||||
}
|
||||
|
||||
resolve_decl(result);
|
||||
if (poly->kind == AST_STRUCT || poly->kind == AST_UNION) type_complete(result->type_val);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Ast_Decl *get_or_instantiate_polymorph_lambda(Token *pos, Ast_Decl *poly, Array<Ast_Call_Item *> params, Ast_Scope *field_access_scope) {
|
||||
// }
|
||||
Reference in New Issue
Block a user