Update lowering for function pointers.

This commit is contained in:
Christoffer Lerno
2024-08-01 11:37:40 +02:00
parent c3e426c82a
commit 3159f036a2

View File

@@ -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: