Files
sx/examples/test_union_array.sx
2026-02-24 17:37:52 +02:00

15 lines
243 B
Plaintext

#import "modules/std.sx";
Vec2 :: union {
data: [2]f32;
struct { x, y: f32; };
}
main :: () {
uv : Vec2 = ---;
uv.x = 1.0;
uv.y = 2.0;
print("promoted-x: {}\n", uv.x);
print("promoted-data0: {}\n", uv.data[0]);
}