mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix issue #515
Modify `check_type_specialization_to` to require exact values to be equal when called with constant basic types. This also now allows procedure group members to differ only by constant value specializations. See the further example in the issue.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user