aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-11-21 13:10:49 +0000
committergingerBill <bill@gingerbill.org>2022-11-21 13:10:49 +0000
commitafea221d64670dcf3cf4a79695c4ae95eeef77a9 (patch)
treebc4ee21d3f50cbd8ae5c735bf9fc3c06dd33620a /src
parentb9ec2de4db0ddc695ba49363188d32d7d30543f9 (diff)
Make structs with the same fields but different tags different types
Fixes #2105
Diffstat (limited to 'src')
-rw-r--r--src/types.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 516096743..28628fd97 100644
--- a/src/types.cpp
+++ b/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) {