mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Merge pull request #3271 from rick-masters/too_many_poly_args
Fix check for too many arguments to a polymorphic record type
This commit is contained in:
+2
-2
@@ -6796,7 +6796,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
|
|||||||
isize index = lookup_polymorphic_record_parameter(original_type, name);
|
isize index = lookup_polymorphic_record_parameter(original_type, name);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
TypeTuple *params = get_record_polymorphic_params(original_type);
|
TypeTuple *params = get_record_polymorphic_params(original_type);
|
||||||
Entity *e = params->variables[i];
|
Entity *e = params->variables[index];
|
||||||
if (e->kind == Entity_Constant) {
|
if (e->kind == Entity_Constant) {
|
||||||
check_expr_with_type_hint(c, &operands[i], fv->value, e->type);
|
check_expr_with_type_hint(c, &operands[i], fv->value, e->type);
|
||||||
continue;
|
continue;
|
||||||
@@ -6847,7 +6847,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
|
|||||||
|
|
||||||
Array<Operand> ordered_operands = operands;
|
Array<Operand> ordered_operands = operands;
|
||||||
if (!named_fields) {
|
if (!named_fields) {
|
||||||
ordered_operands = array_make<Operand>(permanent_allocator(), param_count);
|
ordered_operands = array_make<Operand>(permanent_allocator(), operands.count);
|
||||||
array_copy(&ordered_operands, operands, 0);
|
array_copy(&ordered_operands, operands, 0);
|
||||||
} else {
|
} else {
|
||||||
TEMPORARY_ALLOCATOR_GUARD();
|
TEMPORARY_ALLOCATOR_GUARD();
|
||||||
|
|||||||
Reference in New Issue
Block a user