diff options
| author | gingerBill <bill@gingerbill.org> | 2023-06-20 00:30:29 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-06-20 00:30:29 +0100 |
| commit | 9ec927b9e952cb1e82ec543c95547321273a812b (patch) | |
| tree | 095354117aadb1d0f5eb9d8b4846b01aa446d9f3 /src/types.cpp | |
| parent | 15a0d9f9008362882aed152ba3fecd09f4ce7b28 (diff) | |
Try to get make everything work with parapoly
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/types.cpp b/src/types.cpp index f3b7f5bab..1223132e3 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -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 "); |