mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
27 lines
320 B
V
27 lines
320 B
V
pub struct AA {
|
|
id string
|
|
}
|
|
|
|
pub struct BB {
|
|
pub mut:
|
|
arr []&AA
|
|
}
|
|
|
|
fn test_for_in_mut_reference_selector_val() {
|
|
bb := BB{
|
|
arr: [&AA{
|
|
id: 'Test1'
|
|
}, &AA{
|
|
id: 'Test2'
|
|
}]
|
|
}
|
|
|
|
mut ret := []string{}
|
|
for mut aa in bb.arr {
|
|
println(aa.id)
|
|
ret << aa.id
|
|
}
|
|
println(ret)
|
|
assert ret == ['Test1', 'Test2']
|
|
}
|