mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix pseudo-circular function pointer definitions.
This commit is contained in:
@@ -227,6 +227,7 @@ const char *type_to_error_string(Type *type)
|
||||
return scratch_buffer_copy();
|
||||
}
|
||||
case TYPE_FUNC:
|
||||
if (!type->function.prototype) return type->name;
|
||||
scratch_buffer_clear();
|
||||
scratch_buffer_append("fn ");
|
||||
type_append_func_to_scratch(type->function.prototype);
|
||||
@@ -1369,6 +1370,15 @@ static inline Type *func_create_new_func_proto(Signature *sig, CallABI abi, uint
|
||||
return type;
|
||||
}
|
||||
|
||||
Type *type_get_func_alias(const char *name, Signature *signature, Module *module)
|
||||
{
|
||||
Type *type = type_new(TYPE_FUNC, name);
|
||||
type->canonical = type;
|
||||
type->function.signature = signature;
|
||||
type->function.module = module;
|
||||
return type;
|
||||
}
|
||||
|
||||
Type *type_get_func(Signature *signature, CallABI abi)
|
||||
{
|
||||
uint32_t hash = hash_function(signature);
|
||||
|
||||
Reference in New Issue
Block a user