aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-01-31 20:49:30 +0000
committerGitHub <noreply@github.com>2024-01-31 20:49:30 +0000
commitb703d5ca58ffee584ec416b8daea4d41f9a279ac (patch)
tree3e45babfc17ba1e72d4a7fcd61ad272bc500e11e
parenta4664f82cc2ab46dac8dac0f57cd9adc93bc384d (diff)
parentaff345f57fed6af4414f3adf5704110f8c75a4cf (diff)
Merge pull request #3157 from jakubtomsu/fix-generic-fixed-soa-ptr
Fix polymorphic fixed SOA pointers
-rw-r--r--src/check_type.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 5cb1eb9cc..0a2113e56 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2390,7 +2390,7 @@ gb_internal Type *make_soa_struct_internal(CheckerContext *ctx, Ast *array_typ_e
bool is_polymorphic = is_type_polymorphic(elem);
- if ((!is_polymorphic || soa_kind == StructSoa_Fixed) && !is_type_struct(elem) && !is_type_raw_union(elem) && !(is_type_array(elem) && bt_elem->Array.count <= 4)) {
+ if (!is_polymorphic && !is_type_struct(elem) && !is_type_raw_union(elem) && !(is_type_array(elem) && bt_elem->Array.count <= 4)) {
gbString str = type_to_string(elem);
error(elem_expr, "Invalid type for an #soa array, expected a struct or array of length 4 or below, got '%s'", str);
gb_string_free(str);
@@ -2407,7 +2407,7 @@ gb_internal Type *make_soa_struct_internal(CheckerContext *ctx, Ast *array_typ_e
case StructSoa_Slice: extra_field_count = 1; break;
case StructSoa_Dynamic: extra_field_count = 3; break;
}
- if (is_polymorphic && soa_kind != StructSoa_Fixed) {
+ if (is_polymorphic) {
field_count = 0;
soa_struct = alloc_type_struct();