Try to get make everything work with parapoly

This commit is contained in:
gingerBill
2023-06-20 00:30:29 +01:00
parent 15a0d9f900
commit 9ec927b9e9
3 changed files with 48 additions and 161 deletions
+10 -6
View File
@@ -2108,8 +2108,12 @@ gb_internal bool is_type_polymorphic(Type *t, bool or_specialized=false) {
return is_type_polymorphic(t->Matrix.elem, or_specialized);
case Type_Tuple:
for_array(i, t->Tuple.variables) {
if (is_type_polymorphic(t->Tuple.variables[i]->type, or_specialized)) {
for (Entity *e : t->Tuple.variables) {
if (e->kind == Entity_Constant) {
if (e->Constant.value.kind != ExactValue_Invalid) {
return or_specialized;
}
} else if (is_type_polymorphic(e->type, or_specialized)) {
return true;
}
}
@@ -4279,6 +4283,10 @@ gb_internal gbString write_type_to_string(gbString str, Type *type, bool shortha
if (var == nullptr) {
continue;
}
if (comma_index++ > 0) {
str = gb_string_appendc(str, ", ");
}
String name = var->token.string;
if (var->kind == Entity_Constant) {
str = gb_string_appendc(str, "$");
@@ -4295,10 +4303,6 @@ gb_internal gbString write_type_to_string(gbString str, Type *type, bool shortha
continue;
}
if (comma_index++ > 0) {
str = gb_string_appendc(str, ", ");
}
if (var->kind == Entity_Variable) {
if (var->flags&EntityFlag_CVarArg) {
str = gb_string_appendc(str, "#c_vararg ");