aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-05-13 12:01:16 +0100
committergingerBill <bill@gingerbill.org>2024-05-13 12:01:16 +0100
commit7905f0533f3fbbffec262a97b083d6aae450e46b (patch)
tree3e8274da427c1698c6a4a93b268c1fa1f3fba92b /src/check_type.cpp
parent3fb0d52a745ba7215201234e18995e7489cc1f24 (diff)
Fix #3582 by disallowing it
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 4df0c5d19..8d3c28f06 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -191,9 +191,10 @@ gb_internal void check_struct_fields(CheckerContext *ctx, Ast *node, Slice<Entit
if (is_using && p->names.count > 0) {
Type *first_type = fields_array[fields_array.count-1]->type;
+ bool soa_ptr = is_type_soa_pointer(first_type);
Type *t = base_type(type_deref(first_type));
- if (!does_field_type_allow_using(t) &&
+ if ((soa_ptr || !does_field_type_allow_using(t)) &&
p->names.count >= 1 &&
p->names[0]->kind == Ast_Ident) {
Token name_token = p->names[0]->Ident.token;