v2 / vlib / v / gen / js / tests / auto_deref_args.v
13 lines · 11 sloc · 113 bytes · 0e08d15bc4eb113c5b6dcd6717b1e33d914a0898
Raw
1struct Foo {
2 field &int
3}
4
5fn bar(x int) {
6 println(x)
7}
8
9fn main() {
10 x := 4
11 foo := Foo{&x}
12 bar(foo.field)
13}
14