more forward declarations
This commit is contained in:
14
examples/test_union_array.sx
Normal file
14
examples/test_union_array.sx
Normal file
@@ -0,0 +1,14 @@
|
||||
#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]);
|
||||
}
|
||||
Reference in New Issue
Block a user