mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 16:48:18 +00:00
Fix procedure group compiler assert with no matching arguments #393
This commit is contained in:
+5
-10
@@ -5170,19 +5170,13 @@ CallArgumentData check_call_arguments(CheckerContext *c, Operand *operand, Type
|
||||
|
||||
|
||||
if (valid_count == 0) {
|
||||
bool all_invalid_type = true;
|
||||
for_array(i, operands) {
|
||||
Operand o = operands[i];
|
||||
if (o.type != t_invalid) {
|
||||
all_invalid_type = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!all_invalid_type) {
|
||||
begin_error_block();
|
||||
defer (end_error_block());
|
||||
|
||||
error(operand->expr, "No procedures or ambiguous call for procedure group '%s' that match with the given arguments", expr_name);
|
||||
if (operands.count == 0) {
|
||||
error_line("\tNo given arguments\n");
|
||||
} else {
|
||||
error_line("\tGiven argument types: (");
|
||||
for_array(i, operands) {
|
||||
Operand o = operands[i];
|
||||
@@ -5192,6 +5186,7 @@ CallArgumentData check_call_arguments(CheckerContext *c, Operand *operand, Type
|
||||
error_line("%s", type);
|
||||
}
|
||||
error_line(")\n");
|
||||
}
|
||||
|
||||
if (procs.count > 0) {
|
||||
error_line("Did you mean to use one of the following:\n");
|
||||
@@ -5227,7 +5222,7 @@ CallArgumentData check_call_arguments(CheckerContext *c, Operand *operand, Type
|
||||
if (procs.count > 0) {
|
||||
error_line("\n");
|
||||
}
|
||||
}
|
||||
|
||||
result_type = t_invalid;
|
||||
} else if (valid_count > 1) {
|
||||
begin_error_block();
|
||||
|
||||
Reference in New Issue
Block a user