int i;
assert(clss && (clss->type_op == type_class));
ARR_APP1 (type *, clss->attr.ca.subtypes, subtype);
- for (i = 0; i < get_class_n_subtype(subtype); i++)
- if (get_class_subtype(subtype, i) == clss)
+ for (i = 0; i < get_class_n_supertype(subtype); i++)
+ if (get_class_supertype(subtype, i) == clss)
/* Class already registered */
return;
ARR_APP1 (type *, subtype->attr.ca.supertypes, clss);
assert(clss && (clss->type_op == type_class));
assert(supertype && (supertype -> type_op == type_class));
ARR_APP1 (type *, clss->attr.ca.supertypes, supertype);
- for (i = 0; i < get_class_n_supertype(supertype); i++)
- if (get_class_supertype(supertype, i) == clss)
+ for (i = 0; i < get_class_n_subtype(supertype); i++)
+ if (get_class_subtype(supertype, i) == clss)
/* Class already registered */
return;
ARR_APP1 (type *, supertype->attr.ca.subtypes, clss);