v2 / vlib / v / tests / skip_unused / selector_option.vv
15 lines · 13 sloc · 206 bytes · 49e1012baf67c8af93a6a2b2a4738d09fbf1cc88
Raw
1module main
2
3struct GameObject {
4mut:
5 id int = 1
6 parent ?&GameObject
7}
8
9fn main() {
10 mut gameobject := GameObject{}
11 gameobject.parent = &GameObject{
12 id: 2
13 }
14 println('${gameobject.parent?.id}')
15}
16