feat: 泛型基础设施 — <T>解析 + 类型推断 (单态化 codegen 待补)

This commit is contained in:
2026-06-06 16:17:15 +08:00
parent fa734b8a23
commit 350eeef3c5
9 changed files with 100 additions and 37 deletions
+4 -1
View File
@@ -31,13 +31,16 @@ AstNode* ast_make_program(void* alloc, AstNode** fns, size_t fn_count,
AstNode* ast_make_function(void* alloc, const char* name, AstNode** params, size_t pcount,
TypeKind ret, const char* ret_struct_name, AstNode* body,
bool is_pub, SourceLoc loc) {
bool is_pub, const char** type_params, size_t tp_count,
SourceLoc loc) {
NEW(alloc, AST_FUNCTION);
n->as.function.name = name; n->as.function.params = params;
n->as.function.param_count = pcount; n->as.function.return_type = ret;
n->as.function.return_struct_type_name = ret_struct_name;
n->as.function.body = body;
n->as.function.is_pub = is_pub;
n->as.function.type_params = type_params;
n->as.function.type_param_count = tp_count;
return n;
}