Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
gen
/
c
/
testdata
/
spawn_call_fn_struct_field.vv
18
lines
·
14
sloc
·
214 bytes
·
87141195907f0458d2fca45fec6bed7b09948d26
Raw
1
struct Foo {
2
mut:
3
func1 fn (int) = unsafe { nil }
4
func2 fn (int) = do
5
}
6
7
fn do(a int) {
8
println('hello')
9
}
10
11
mut foo := Foo{}
12
13
foo.func1 = do
14
mut p := spawn foo.func1(1)
15
p.wait()
16
17
p = spawn foo.func2(1)
18
p.wait()
19