fix ambiguous generic type names

This commit is contained in:
fusion32
2024-08-23 17:18:10 -03:00
parent d410281766
commit c969bee86d

View File

@@ -7625,7 +7625,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
gbString s = gb_string_make_reserve(heap_allocator(), e->token.string.len+3);
s = gb_string_append_fmt(s, "%.*s(", LIT(e->token.string));
TypeTuple *tuple = get_record_polymorphic_params(e->type);
TypeTuple *tuple = get_record_polymorphic_params(bt);
if (tuple != nullptr) for_array(i, tuple->variables) {
Entity *v = tuple->variables[i];
String name = v->token.string;
@@ -7640,8 +7640,10 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
s = write_type_to_string(s, v->type, false);
}
} else if (v->kind == Entity_Constant) {
s = gb_string_append_fmt(s, "=");
s = write_exact_value_to_string(s, v->Constant.value);
if (v->type->kind != ExactValue_Invalid) {
s = gb_string_append_fmt(s, "=");
s = write_exact_value_to_string(s, v->Constant.value);
}
}
}
s = gb_string_append_fmt(s, ")");