| 1 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:2:1: error: top level declaration cannot shadow builtin type |
| 2 | 1 | @[inline] |
| 3 | 2 | fn char(ch u8) fn (string) !(u8, string) { |
| 4 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 5 | 3 | return fn [ch] (input string) !(u8, string) { |
| 6 | 4 | return if input[0] == ch { |
| 7 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:18:18: error: unknown function: a_char |
| 8 | 16 | |
| 9 | 17 | for i, input in inputs { |
| 10 | 18 | got, remain := a_char(input)! |
| 11 | | ~~~~~~~~~~~~~ |
| 12 | 19 | |
| 13 | 20 | assert got == 'a'[0] |
| 14 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:18:31: error: unexpected `!`, the function `a_char` does not return a Result |
| 15 | 16 | |
| 16 | 17 | for i, input in inputs { |
| 17 | 18 | got, remain := a_char(input)! |
| 18 | | ^ |
| 19 | 19 | |
| 20 | 20 | assert got == 'a'[0] |
| 21 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:18:15: error: assignment mismatch: 2 variables but `a_char()` returns 0 values |
| 22 | 16 | |
| 23 | 17 | for i, input in inputs { |
| 24 | 18 | got, remain := a_char(input)! |
| 25 | | ~~ |
| 26 | 19 | |
| 27 | 20 | assert got == 'a'[0] |
| 28 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:20:10: error: invalid variable `got` |
| 29 | 18 | got, remain := a_char(input)! |
| 30 | 19 | |
| 31 | 20 | assert got == 'a'[0] |
| 32 | | ~~~ |
| 33 | 21 | assert remain == remains[i] |
| 34 | 22 | } |
| 35 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:20:10: error: assert can be used only with `bool` expressions, but found `void` instead |
| 36 | 18 | got, remain := a_char(input)! |
| 37 | 19 | |
| 38 | 20 | assert got == 'a'[0] |
| 39 | | ~~~~~~~~~~~~~ |
| 40 | 21 | assert remain == remains[i] |
| 41 | 22 | } |
| 42 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:21:10: error: invalid variable `remain` |
| 43 | 19 | |
| 44 | 20 | assert got == 'a'[0] |
| 45 | 21 | assert remain == remains[i] |
| 46 | | ~~~~~~ |
| 47 | 22 | } |
| 48 | 23 | } |
| 49 | vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:21:10: error: assert can be used only with `bool` expressions, but found `void` instead |
| 50 | 19 | |
| 51 | 20 | assert got == 'a'[0] |
| 52 | 21 | assert remain == remains[i] |
| 53 | | ~~~~~~~~~~~~~~~~~~~~ |
| 54 | 22 | } |
| 55 | 23 | } |
| 56 | |