mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Update lowering for function pointers.
This commit is contained in:
@@ -37,10 +37,12 @@ static inline Type *type_lowering(Type *type)
|
||||
type = type->decl->enums.type_info->type;
|
||||
continue;
|
||||
case TYPE_FUNC_PTR:
|
||||
if (type->pointer->function.prototype->raw_type == type->pointer) return type;
|
||||
return type_get_func_ptr(type->pointer->function.prototype->raw_type);
|
||||
case TYPE_FUNC_RAW:
|
||||
return type->function.prototype->raw_type;
|
||||
{
|
||||
Type *raw_func = type->pointer;
|
||||
if (raw_func->function.prototype && raw_func->function.prototype->raw_type == raw_func) return type;
|
||||
FunctionPrototype *proto = type_get_resolved_prototype(raw_func);
|
||||
return type_get_func_ptr(proto->raw_type);
|
||||
}
|
||||
case TYPE_INTERFACE:
|
||||
return type_any;
|
||||
case TYPE_ANYFAULT:
|
||||
|
||||
Reference in New Issue
Block a user