aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/v/checker/tests/union_unsafe_fields.vv
diff options
context:
space:
mode:
Diffstat (limited to 'v_windows/v/vlib/v/checker/tests/union_unsafe_fields.vv')
-rw-r--r--v_windows/v/vlib/v/checker/tests/union_unsafe_fields.vv12
1 files changed, 12 insertions, 0 deletions
diff --git a/v_windows/v/vlib/v/checker/tests/union_unsafe_fields.vv b/v_windows/v/vlib/v/checker/tests/union_unsafe_fields.vv
new file mode 100644
index 0000000..6a1bc0f
--- /dev/null
+++ b/v_windows/v/vlib/v/checker/tests/union_unsafe_fields.vv
@@ -0,0 +1,12 @@
+union Uf32 {
+mut:
+ f f32
+ u u32
+}
+
+fn f() f32 {
+ mut u := Uf32{u: 3}
+ u.f = 3.3 // ok
+ _ := u.u
+ return &u.f
+}