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

View File

@@ -1253,7 +1253,13 @@ bool check_type_specialization_to(CheckerContext *ctx, Type *specialization, Typ
e->type = t_e->type;
}
} else {
bool ok = is_polymorphic_type_assignable(ctx, st, tt, true, modify_type);
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 {
bool ok = is_polymorphic_type_assignable(ctx, st, tt, true, modify_type);
}
}
}