v/vlib/v/checker/tests/union_unsafe_fields.vv

13 lines
111 B
V

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
}