commit 645c18098f2278fce099d7648e68d82607696300
parent 697e1d64a0f57290f7fd3eebc548cd2f19830ef5
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 16 Jan 2021 11:22:04 -0500
type store: correct issue with nested tagged unions
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/type_store.c b/src/type_store.c
@@ -436,7 +436,7 @@ collect_atagged_memb(struct type_store *store,
{
for (; atu; atu = atu->next) {
if (atu->type->storage == TYPE_STORAGE_TAGGED_UNION) {
- collect_atagged_memb(store, ta, atu, i);
+ collect_atagged_memb(store, ta, &atu->type->tagged_union, i);
continue;
}
struct type_tagged_union *tu;
diff --git a/tests/13-tagged.ha b/tests/13-tagged.ha
@@ -47,6 +47,7 @@ fn reduction() void = {
assert(a is i8);
assert(b is i8);
assert(c is i8);
+ assert(size((i8 | i16 | i32)) == size((i8 | (i16 | i32))));
};
export fn main() void = {