diff options
| author | 2022-08-07 22:36:57 +0200 | |
|---|---|---|
| committer | 2022-08-07 22:36:57 +0200 | |
| commit | 96ef1857bac446f4e065e7c10530213e361d726a (patch) | |
| tree | 2c5241e4f7cf03d3498ff3114ca315ea076c855c /bootstrap/test2.cff | |
| parent | e305f71c3cbd685eacb77451b3728b2cac492d71 (diff) | |
add tagged unions
Diffstat (limited to 'bootstrap/test2.cff')
| -rw-r--r-- | bootstrap/test2.cff | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstrap/test2.cff b/bootstrap/test2.cff index 3061d6e..e5e484a 100644 --- a/bootstrap/test2.cff +++ b/bootstrap/test2.cff @@ -18,6 +18,12 @@ struct Bit<T> { def Y = 3.3; +enum union Value { + None, + Int i32, + Flo f32, +} + extern fn main() void { let n Node<int> = {#null, 0}; let n Node<int> = {&n, 1}; @@ -25,6 +31,9 @@ extern fn main() void { let x int #?; x = X + 1 + Y; + let v Value = :None; + v = :Int 3; + printf("n %d\n", n.value); printf("n link %d\n", n.link.value); |