1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/checker/tests/go_wait_or.out

49 lines
2.2 KiB
Plaintext

vlib/v/checker/tests/go_wait_or.vv:11:16: error: unexpected `?`, the function `wait` does not return an Option or a Result
9 | spawn d(1)
10 | ]
11 | r := tg.wait()?
| ^
12 | println(r)
13 | s := tg[0].wait() or { panic('problem') }
vlib/v/checker/tests/go_wait_or.vv:13:20: error: unexpected `or` block, the function `wait` does not return an Option or a Result
11 | r := tg.wait()?
12 | println(r)
13 | s := tg[0].wait() or { panic('problem') }
| ~~~~~~~~~~~~~~~~~~~~~~~
14 | println(s)
15 | tg2 := [
vlib/v/checker/tests/go_wait_or.vv:19:13: error: unexpected `or` block, the function `wait` does not return an Option or a Result
17 | spawn e(1)
18 | ]
19 | tg2.wait() or { panic('problem') }
| ~~~~~~~~~~~~~~~~~~~~~~~
20 | tg2[0].wait()?
21 | tg3 := [
vlib/v/checker/tests/go_wait_or.vv:20:15: error: unexpected `?`, the function `wait` does not return an Option or a Result
18 | ]
19 | tg2.wait() or { panic('problem') }
20 | tg2[0].wait()?
| ^
21 | tg3 := [
22 | spawn f(0)
vlib/v/checker/tests/go_wait_or.vv:25:6: error: `.wait()` cannot be called for an array when thread functions return options. Iterate over the arrays elements instead and handle each returned option with `or`.
23 | spawn f(1)
24 | ]
25 | tg3.wait() or { panic('problem') }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 | for t in tg3 {
27 | a := t.wait()
vlib/v/checker/tests/go_wait_or.vv:38:6: error: `.wait()` cannot be called for an array when thread functions return options. Iterate over the arrays elements instead and handle each returned option with `or`.
36 | spawn g(1)
37 | ]
38 | tg4.wait()
| ~~~~~~
39 | tg4[0].wait()
40 | spawn g(3) or { panic('problem') }
vlib/v/checker/tests/go_wait_or.vv:40:13: error: option handling cannot be done in `spawn` call. Do it when calling `.wait()`
38 | tg4.wait()
39 | tg4[0].wait()
40 | spawn g(3) or { panic('problem') }
| ~~~~~~~~~~~~~~~~~~~~~~~
41 | }