mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 18:02:02 +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;
|
||||
}
|
||||
|
||||
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;
|
||||
for (isize i = 0; i < param_count; i++) {
|
||||
Operand *o = &ordered_operands[i];
|
||||
|
||||
Reference in New Issue
Block a user