mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix polymorphic type parameter argument count checking #298
This commit is contained in:
@@ -4970,6 +4970,18 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (param_count < ordered_operands.count) {
|
||||||
|
error(call, "Too many polymorphic type arguments, expected %td, got %td", param_count, ordered_operands.count);
|
||||||
|
err = CallArgumentError_TooManyArguments;
|
||||||
|
} else if (param_count > ordered_operands.count) {
|
||||||
|
error(call, "Too few polymorphic type arguments, expected %td, got %td", param_count, ordered_operands.count);
|
||||||
|
err = CallArgumentError_TooFewArguments;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err != 0) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
i64 score = 0;
|
i64 score = 0;
|
||||||
for (isize i = 0; i < param_count; i++) {
|
for (isize i = 0; i < param_count; i++) {
|
||||||
Operand *o = &ordered_operands[i];
|
Operand *o = &ordered_operands[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user