mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Allow for cycles in record polymorphic parameters but not in actualized fields
This commit is contained in:
@@ -6127,6 +6127,14 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper
|
|||||||
defer (array_free(&operands));
|
defer (array_free(&operands));
|
||||||
|
|
||||||
bool named_fields = false;
|
bool named_fields = false;
|
||||||
|
{
|
||||||
|
// NOTE(bill, 2019-10-26): Allow a cycle in the parameters but not in the fields themselves
|
||||||
|
auto prev_type_path = c->type_path;
|
||||||
|
c->type_path = new_checker_type_path();
|
||||||
|
defer ({
|
||||||
|
destroy_checker_type_path(c->type_path);
|
||||||
|
c->type_path = prev_type_path;
|
||||||
|
});
|
||||||
|
|
||||||
if (is_call_expr_field_value(ce)) {
|
if (is_call_expr_field_value(ce)) {
|
||||||
named_fields = true;
|
named_fields = true;
|
||||||
@@ -6170,6 +6178,8 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper
|
|||||||
check_unpack_arguments(c, lhs, lhs_count, &operands, ce->args, false, false);
|
check_unpack_arguments(c, lhs, lhs_count, &operands, ce->args, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
CallArgumentError err = CallArgumentError_None;
|
CallArgumentError err = CallArgumentError_None;
|
||||||
|
|
||||||
TypeTuple *tuple = get_record_polymorphic_params(original_type);
|
TypeTuple *tuple = get_record_polymorphic_params(original_type);
|
||||||
|
|||||||
Reference in New Issue
Block a user