mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
16 lines
216 B
V
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'
|
|
}
|