Merge pull request #733 from bttelle/issue-515

Fix issue #515
This commit is contained in:
gingerBill
2020-09-14 14:07:02 +01:00
committed by GitHub
+6
View File
@@ -1252,10 +1252,16 @@ bool check_type_specialization_to(CheckerContext *ctx, Type *specialization, Typ
e->Constant.value = t_e->Constant.value; e->Constant.value = t_e->Constant.value;
e->type = t_e->type; e->type = t_e->type;
} }
} else {
if (st->kind == Type_Basic && tt->kind == Type_Basic &&
s_e->kind == Entity_Constant && t_e->kind == Entity_Constant) {
if (!compare_exact_values(Token_CmpEq, s_e->Constant.value, t_e->Constant.value))
return false;
} else { } else {
bool ok = is_polymorphic_type_assignable(ctx, st, tt, true, modify_type); bool ok = is_polymorphic_type_assignable(ctx, st, tt, true, modify_type);
} }
} }
}
if (modify_type) { if (modify_type) {
// NOTE(bill): This is needed in order to change the actual type but still have the types defined within it // NOTE(bill): This is needed in order to change the actual type but still have the types defined within it