Browse Source

Make structs with the same fields but different tags different types

Fixes #2105
gingerBill 2 years ago
parent
commit
afea221d64
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/types.cpp

+ 3 - 0
src/types.cpp

@@ -2705,6 +2705,9 @@ bool are_types_identical_internal(Type *x, Type *y, bool check_tuple_names) {
 					if (xf->token.string != yf->token.string) {
 						return false;
 					}
+					if (x->Struct.tags[i] != y->Struct.tags[i]) {
+						return false;
+					}
 					u64 xf_flags = (xf->flags&EntityFlags_IsSubtype);
 					u64 yf_flags = (yf->flags&EntityFlags_IsSubtype);
 					if (xf_flags != yf_flags) {