v2 / vlib / v / gen / c / testdata / struct_fn_member_print.vv
18 lines · 14 sloc · 221 bytes · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1module main
2
3type Function = fn (int)
4
5struct MyStruct {
6 func Function @[required]
7}
8
9fn implementation(size int) {
10 println('size is ${size}')
11}
12
13fn main() {
14 m := MyStruct{
15 func: implementation
16 }
17 println('${m}')
18}
19