union type allow for any types and removes common fields

This commit is contained in:
Ginger Bill
2017-07-10 22:32:21 +01:00
parent ce4b7b8b7d
commit fd8c4d58bb
10 changed files with 356 additions and 467 deletions
+2 -2
View File
@@ -1504,8 +1504,8 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
GB_ASSERT(is_type_union(bt));
bool tag_type_found = false;
for (isize i = 0; i < bt->Record.variant_count; i++) {
Entity *f = bt->Record.variants[i];
if (are_types_identical(f->type, y.type)) {
Type *vt = bt->Record.variants[i];
if (are_types_identical(vt, y.type)) {
tag_type_found = true;
break;
}