From 82cdf010329c4ac6827698689e7e39644fad07b6 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 6 May 2023 22:06:25 +0300 Subject: rename *.cu to *.ek + Name changes can be sort of difficult --- tests/unions.ek | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/unions.ek (limited to 'tests/unions.ek') diff --git a/tests/unions.ek b/tests/unions.ek new file mode 100644 index 0000000..6c3edc5 --- /dev/null +++ b/tests/unions.ek @@ -0,0 +1,23 @@ +typedef any {} + +union basic_union { + a u32; + b i64; + c f32; +} + +union complex_union(A any, B any, C any) { + a A; + b B; + c C; +} + +main() +{ + simple_named const = {.b = 1} as basic_union; + simple_ordinal const = {1 as u32} 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); +} -- cgit v1.3