aboutsummaryrefslogtreecommitdiff
path: root/tests/unions.ek
blob: b493d5a91e2c6ec68b68662eca5890c47866fa9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
typedef any {}

union basic_union {
	u32 a;
	i64 b;
	f32 c;
}

union complex_union(any A, any B, any C) {
	A a;
	B b;
	C c;
}

main()
{
	const simple_named = {.b = 1} as basic_union;

	// TODO: unions should be fully actualized
	const complex_named = {.b = 1} as complex_union![u32, i64, f32];
}