mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 05:08:14 +00:00
Start work on parapoly args for new and improved
This commit is contained in:
+4
-14
@@ -6898,9 +6898,6 @@ gb_internal CallArgumentData check_call_arguments_new_and_improved(CheckerContex
|
|||||||
Entity *e = entity_of_node(ident);
|
Entity *e = entity_of_node(ident);
|
||||||
|
|
||||||
TokenPos pos = ast_token(call).pos;
|
TokenPos pos = ast_token(call).pos;
|
||||||
if (pos.line == 282 && pos.column == 9 && is_type_polymorphic(proc_type)) {
|
|
||||||
// GB_PANIC("HERE! %s\n", expr_to_string(call));
|
|
||||||
}
|
|
||||||
|
|
||||||
CallArgumentError err = check_call_arguments_internal(c, call, proc_type, e, positional_operands, named_operands, CallArgumentMode_ShowErrors, &data);
|
CallArgumentError err = check_call_arguments_internal(c, call, proc_type, e, positional_operands, named_operands, CallArgumentMode_ShowErrors, &data);
|
||||||
gb_unused(err);
|
gb_unused(err);
|
||||||
@@ -6908,6 +6905,7 @@ gb_internal CallArgumentData check_call_arguments_new_and_improved(CheckerContex
|
|||||||
add_entity_use(c, ident, entity_to_use);
|
add_entity_use(c, ident, entity_to_use);
|
||||||
if (entity_to_use != nullptr) {
|
if (entity_to_use != nullptr) {
|
||||||
update_untyped_expr_type(c, operand->expr, entity_to_use->type, true);
|
update_untyped_expr_type(c, operand->expr, entity_to_use->type, true);
|
||||||
|
add_type_and_value(c, operand->expr, operand->mode, entity_to_use->type, operand->value);
|
||||||
}
|
}
|
||||||
if (data.gen_entity != nullptr) {
|
if (data.gen_entity != nullptr) {
|
||||||
Entity *e = data.gen_entity;
|
Entity *e = data.gen_entity;
|
||||||
@@ -6931,6 +6929,7 @@ gb_internal CallArgumentData check_call_arguments_new_and_improved(CheckerContex
|
|||||||
Type *t = base_type(entity_to_use->type);
|
Type *t = base_type(entity_to_use->type);
|
||||||
// GB_ASSERT_MSG(!is_type_polymorphic(t), "%s", expr_to_string(call));
|
// GB_ASSERT_MSG(!is_type_polymorphic(t), "%s", expr_to_string(call));
|
||||||
data.result_type = t->Proc.results;
|
data.result_type = t->Proc.results;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (pt) {
|
} else if (pt) {
|
||||||
@@ -6954,17 +6953,8 @@ gb_internal CallArgumentData check_call_arguments(CheckerContext *c, Operand *op
|
|||||||
if (all_non_poly) {
|
if (all_non_poly) {
|
||||||
return check_call_arguments_new_and_improved(c, operand, call);
|
return check_call_arguments_new_and_improved(c, operand, call);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
return check_call_arguments_new_and_improved(c, operand, call);
|
||||||
if (operand->mode != Addressing_ProcGroup) {
|
|
||||||
bool is_poly = is_type_polymorphic(operand->type);
|
|
||||||
bool ok = !is_poly;
|
|
||||||
if (!ok && c->pkg->name == "bug") {
|
|
||||||
ok = true;
|
|
||||||
}
|
|
||||||
if (ok) {
|
|
||||||
return check_call_arguments_new_and_improved(c, operand, call);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_node(ce, CallExpr, call);
|
ast_node(ce, CallExpr, call);
|
||||||
|
|||||||
@@ -3250,7 +3250,7 @@ gb_internal lbValue lb_build_call_expr_internal_with_arg_split_args(lbProcedure
|
|||||||
args[i] = lb_handle_param_value(p, e->type, e->Variable.param_value, pos);
|
args[i] = lb_handle_param_value(p, e->type, e->Variable.param_value, pos);
|
||||||
break;
|
break;
|
||||||
case Entity_Constant:
|
case Entity_Constant:
|
||||||
GB_PANIC("TODO constant parameter");
|
args[i] = lb_handle_param_value(p, e->type, e->Constant.param_value, pos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user