Better error messages for import cycles

This commit is contained in:
Ginger Bill
2017-10-08 10:58:16 +01:00
parent df7a4eda8a
commit 56a98a483f
5 changed files with 248 additions and 58 deletions

View File

@@ -1120,6 +1120,24 @@ bool are_types_identical(Type *x, Type *y) {
}
break;
case Type_BitField:
if (y->kind == Type_BitField) {
if (x->BitField.field_count == y->BitField.field_count &&
x->BitField.custom_align == y->BitField.custom_align) {
for (i32 i = 0; i < x->BitField.field_count; i++) {
if (x->BitField.offsets[i] != y->BitField.offsets[i]) {
return false;
}
if (x->BitField.sizes[i] != y->BitField.sizes[i]) {
return false;
}
}
return true;
}
}
break;
case Type_Enum:
return x == y; // NOTE(bill): All enums are unique