core: type: fix registration of types that extend something other than b_object

This commit is contained in:
2025-10-24 12:29:24 +01:00
parent 36b624849c
commit ed105307c7
2 changed files with 10 additions and 2 deletions

View File

@@ -24,10 +24,15 @@ typedef const union b_type {
unsigned char b[16]; unsigned char b[16];
} *b_type; } *b_type;
typedef enum b_type_flags {
B_TYPE_F_ABSTRACT = 0x01u,
} b_type_flags;
typedef struct b_type_info { typedef struct b_type_info {
union b_type t_id; union b_type t_id;
union b_type t_parent_id; union b_type t_parent_id;
const char *t_name; const char *t_name;
b_type_flags t_flags;
union b_type t_interfaces[B_TYPE_MAX_INTERFACES]; union b_type t_interfaces[B_TYPE_MAX_INTERFACES];
size_t t_nr_interfaces; size_t t_nr_interfaces;
size_t t_class_size; size_t t_class_size;

View File

@@ -208,8 +208,9 @@ static b_result find_type_components(struct b_type_registration *reg)
comp = b_type_get_component(&reg->r_components, current_id); comp = b_type_get_component(&reg->r_components, current_id);
if (comp) { if (comp) {
/* circular class dependency */ /* circular class dependency */
result = B_RESULT_ERR(INVALID_ARGUMENT); // result = B_RESULT_ERR(INVALID_ARGUMENT);
break; // break;
continue;
} }
comp = create_type_component(dep_class); comp = create_type_component(dep_class);
@@ -227,6 +228,8 @@ static b_result find_type_components(struct b_type_registration *reg)
if (b_type_id_compare(current_id, B_TYPE_OBJECT) == 0) { if (b_type_id_compare(current_id, B_TYPE_OBJECT) == 0) {
break; break;
} }
current_id = &dep_class->r_info->t_parent_id;
} }
b_queue_iterator q_it; b_queue_iterator q_it;