mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Warn on 'expand_to_tuple' has been replaced with 'expand_values'
This commit is contained in:
@@ -6744,6 +6744,10 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
|
|||||||
|
|
||||||
if (operand->mode == Addressing_Builtin) {
|
if (operand->mode == Addressing_Builtin) {
|
||||||
i32 id = operand->builtin_id;
|
i32 id = operand->builtin_id;
|
||||||
|
Entity *e = entity_of_node(operand->expr);
|
||||||
|
if (e != nullptr && e->token.string == "expand_to_tuple") {
|
||||||
|
warning(operand->expr, "'expand_to_tuple' has been replaced with 'expand_values'");
|
||||||
|
}
|
||||||
if (!check_builtin_procedure(c, operand, call, id, type_hint)) {
|
if (!check_builtin_procedure(c, operand, call, id, type_hint)) {
|
||||||
operand->mode = Addressing_Invalid;
|
operand->mode = Addressing_Invalid;
|
||||||
operand->type = t_invalid;
|
operand->type = t_invalid;
|
||||||
|
|||||||
@@ -1070,6 +1070,13 @@ gb_internal void init_universal(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
BuiltinProcId id = BuiltinProc_expand_values;
|
||||||
|
String name = str_lit("expand_to_tuple");
|
||||||
|
Entity *entity = alloc_entity(Entity_Builtin, nullptr, make_token_ident(name), t_invalid);
|
||||||
|
entity->Builtin.id = id;
|
||||||
|
add_global_entity(entity, builtin_pkg->scope);
|
||||||
|
}
|
||||||
|
|
||||||
bool defined_values_double_declaration = false;
|
bool defined_values_double_declaration = false;
|
||||||
for (auto const &entry : bc->defined_values) {
|
for (auto const &entry : bc->defined_values) {
|
||||||
|
|||||||
Reference in New Issue
Block a user