v2 / vlib / v / tests / builtin_arrays / array_ptr_compare_test.v
24 lines · 21 sloc · 318 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1@[heap]
2struct Particle {
3}
4
5@[heap]
6struct App {
7mut:
8 list_opti [][]&Particle
9}
10
11fn (mut app App) init_opti_list() {
12 for mut liste in app.list_opti {
13 if liste != [] {
14 liste.clear()
15 }
16 }
17}
18
19fn test_main() {
20 mut app := &App{
21 list_opti: [][]&Particle{len: 10, init: []&Particle{}}
22 }
23 app.init_opti_list()
24}
25