| 1 | vlib/v/checker/tests/method_call_on_undefined_err.vv:6:10: error: undefined ident: `input` |
| 2 | 4 | fn foo() !string { |
| 3 | 5 | // without next error does not occurs |
| 4 | 6 | a, b := input.split_once('%') or { '', 'empty' } |
| 5 | | ~~~~~ |
| 6 | 7 | if b == '' { |
| 7 | 8 | return error('') |
| 8 | vlib/v/checker/tests/method_call_on_undefined_err.vv:6:32: error: unexpected `or` block, the function `split_once` does not return an Option or a Result |
| 9 | 4 | fn foo() !string { |
| 10 | 5 | // without next error does not occurs |
| 11 | 6 | a, b := input.split_once('%') or { '', 'empty' } |
| 12 | | ~~~~~~~~~~~~~~~~~~ |
| 13 | 7 | if b == '' { |
| 14 | 8 | return error('') |
| 15 | vlib/v/checker/tests/method_call_on_undefined_err.vv:6:7: error: assignment mismatch: 2 variables but `split_once()` returns 0 values |
| 16 | 4 | fn foo() !string { |
| 17 | 5 | // without next error does not occurs |
| 18 | 6 | a, b := input.split_once('%') or { '', 'empty' } |
| 19 | | ~~ |
| 20 | 7 | if b == '' { |
| 21 | 8 | return error('') |
| 22 | vlib/v/checker/tests/method_call_on_undefined_err.vv:7:5: error: invalid variable `b` |
| 23 | 5 | // without next error does not occurs |
| 24 | 6 | a, b := input.split_once('%') or { '', 'empty' } |
| 25 | 7 | if b == '' { |
| 26 | | ^ |
| 27 | 8 | return error('') |
| 28 | 9 | } |
| 29 | vlib/v/checker/tests/method_call_on_undefined_err.vv:7:5: error: non-bool type `void` used as if condition |
| 30 | 5 | // without next error does not occurs |
| 31 | 6 | a, b := input.split_once('%') or { '', 'empty' } |
| 32 | 7 | if b == '' { |
| 33 | | ~~~~~~~ |
| 34 | 8 | return error('') |
| 35 | 9 | } |
| 36 | vlib/v/checker/tests/method_call_on_undefined_err.vv:10:9: error: invalid variable `a` |
| 37 | 8 | return error('') |
| 38 | 9 | } |
| 39 | 10 | return a |
| 40 | | ^ |
| 41 | 11 | } |
| 42 | 12 | |
| 43 | vlib/v/checker/tests/method_call_on_undefined_err.vv:10:2: error: `a` used as value |
| 44 | 8 | return error('') |
| 45 | 9 | } |
| 46 | 10 | return a |
| 47 | | ~~~~~~~~ |
| 48 | 11 | } |
| 49 | 12 | |
| 50 | vlib/v/checker/tests/method_call_on_undefined_err.vv:14:13: error: expected 0 arguments, but got 1 |
| 51 | 12 | |
| 52 | 13 | fn main() { |
| 53 | 14 | res := foo('fe80::1234%ne0') or { |
| 54 | | ~~~~~~~~~~~~~~~~ |
| 55 | 15 | eprintln(err) |
| 56 | 16 | exit(1) |
| 57 | Details: have (string) |
| 58 | want () |
| 59 | |