Fix Internal Compiler Error: Type_Info for 'XXX' could not be found #507

This commit is contained in:
gingerBill
2019-12-22 14:16:56 +00:00
parent cc2fa8f756
commit 1d14b3059e
4 changed files with 20 additions and 11 deletions

View File

@@ -1435,7 +1435,12 @@ void add_min_dep_type_info(Checker *c, Type *t) {
auto *set = &c->info.minimum_dependency_type_info_set;
isize ti_index = type_info_index(&c->info, t);
isize ti_index = type_info_index(&c->info, t, false);
if (ti_index < 0) {
add_type_info_type(&c->init_ctx, t); // Missing the type information
ti_index = type_info_index(&c->info, t, false);
}
GB_ASSERT(ti_index >= 0);
if (ptr_set_exists(set, ti_index)) {
// Type Already exists
return;
@@ -1528,16 +1533,16 @@ void add_min_dep_type_info(Checker *c, Type *t) {
break;
case Type_Struct:
for_array(i, bt->Struct.fields) {
Entity *f = bt->Struct.fields[i];
add_min_dep_type_info(c, f->type);
}
if (bt->Struct.scope != nullptr) {
for_array(i, bt->Struct.scope->elements.entries) {
Entity *e = bt->Struct.scope->elements.entries[i].value;
add_min_dep_type_info(c, e->type);
}
}
for_array(i, bt->Struct.fields) {
Entity *f = bt->Struct.fields[i];
add_min_dep_type_info(c, f->type);
}
break;
case Type_BitFieldValue: