commit 73cd19bedec43d9e0bc9d57d9470b395869eef08
parent b1f29e024d5c9efbe53ebe2d31153809bc9ec9af
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 17 Jan 2021 14:48:18 -0500
tests/07-aliases: uncomment now-supported code
Diffstat:
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/tests/07-aliases.ha b/tests/07-aliases.ha
@@ -69,14 +69,13 @@ fn alias_struct() void = {
assert(v.x.y == 69, "struct alias ptr ptr alias");
};
-// TODO: tagged unions
-//type my_tagged = (int | void);
+type my_tagged = (int | void);
-//fn alias_tagged() void = {
-// let a: my_tagged = 42;
-// assert(a is int, "tag");
-// assert(a as int == 42, "value");
-//};
+fn alias_tagged() void = {
+ let a: my_tagged = 42;
+ assert(a is int, "tag");
+ assert(a as int == 42, "value");
+};
type my_my_array = my_array;
type my_my_int = my_int;
@@ -94,6 +93,6 @@ export fn main() void = {
alias_array();
alias_fn();
alias_struct();
- //alias_tagged();
+ alias_tagged();
alias_alias();
};