Browse Source

Fix #3582 by disallowing it

gingerBill 1 year ago
parent
commit
7905f0533f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/check_type.cpp

+ 2 - 1
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) {
 		if (is_using && p->names.count > 0) {
 			Type *first_type = fields_array[fields_array.count-1]->type;
 			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));
 			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.count >= 1 &&
 			    p->names[0]->kind == Ast_Ident) {
 			    p->names[0]->kind == Ast_Ident) {
 				Token name_token = p->names[0]->Ident.token;
 				Token name_token = p->names[0]->Ident.token;