mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
22 lines
256 B
V
22 lines
256 B
V
struct Test {
|
|
sub SubTest
|
|
}
|
|
|
|
struct SubTest {
|
|
test string
|
|
}
|
|
|
|
fn test_method_go_wait() {
|
|
a := Test{
|
|
sub: SubTest{
|
|
test: 'hi'
|
|
}
|
|
}
|
|
thread := spawn a.sub.get()
|
|
r := thread.wait()
|
|
assert r == 'hi'
|
|
}
|
|
|
|
fn (t SubTest) get() string {
|
|
return t.test
|
|
}
|