Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
fmt
/
tests
/
struct_init_with_custom_len_keep.vv
17
lines
·
15
sloc
·
174 bytes
·
017ace6ea7402430a992aa0820d5e472ebca74c7
Raw
1
struct Foo {
2
i int
3
a []int
4
}
5
6
struct Bar {
7
f &Foo = &Foo(0)
8
d Foo = Foo{0}
9
}
10
11
fn main() {
12
size := 5
13
f := &Foo{
14
a: []int{len: int(size)}
15
}
16
println('f.a: ${f.a}')
17
}
18