vxx2 / vlib / v / checker / tests / immutable_deref.vv
11 lines · 9 sloc · 129 bytes · e995d991f1279d3cee90bc4ea022f6cbcbedba96
Raw
1struct Context {}
2
3const ctx_ptr = &Context(unsafe { nil })
4
5fn main() {
6 x := &ctx_ptr
7 unsafe {
8 *x = &Context{}
9 _ = x
10 }
11}
12