1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/go_anon_fn_call_with_ref_arg_test.v
2022-11-05 10:46:40 +03:00

16 lines
216 B
V

struct Foo {
bar string
}
fn test_go_anon_fn_call_with_ref_arg() {
foo := &Foo{
bar: 'hello'
}
g := spawn fn (foo Foo) string {
return foo.bar
}(foo)
ret := g.wait()
println(ret)
assert ret == 'hello'
}