aboutsummaryrefslogtreecommitdiff
path: root/tests/unions.ek
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-09-05 18:30:01 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-10-31 12:30:09 +0200
commitfed864bf018e7d97fda24089ebe08fa0da1c3b97 (patch)
tree709dddea28995c58931f28a69525258129aa2fef /tests/unions.ek
parenta06ed46bffa94e4613052e0ddf0cb70ab32651ab (diff)
downloadek-fed864bf018e7d97fda24089ebe08fa0da1c3b97.tar.gz
ek-fed864bf018e7d97fda24089ebe08fa0da1c3b97.zip
more or less happy with syntax
Diffstat (limited to 'tests/unions.ek')
-rw-r--r--tests/unions.ek20
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/unions.ek b/tests/unions.ek
index 6c3edc5..b493d5a 100644
--- a/tests/unions.ek
+++ b/tests/unions.ek
@@ -1,23 +1,21 @@
typedef any {}
union basic_union {
- a u32;
- b i64;
- c f32;
+ u32 a;
+ i64 b;
+ f32 c;
}
-union complex_union(A any, B any, C any) {
- a A;
- b B;
- c C;
+union complex_union(any A, any B, any C) {
+ A a;
+ B b;
+ C c;
}
main()
{
- simple_named const = {.b = 1} as basic_union;
- simple_ordinal const = {1 as u32} as basic_union;
+ const simple_named = {.b = 1} as basic_union;
// TODO: unions should be fully actualized
- complex_named const = {.b = 1} as complex_union(u32, i64, f32);
- complex_ordinal const = {1 as u32} as complex_union(u32, i64, f32);
+ const complex_named = {.b = 1} as complex_union![u32, i64, f32];
}