| 1 | vlib/v/checker/tests/undefined_ident_in_ref_selector.vv:6:10: error: undefined ident: `line` |
| 2 | 4 | |
| 3 | 5 | fn read() int { |
| 4 | 6 | return &line.len |
| 5 | | ~~~~ |
| 6 | 7 | } |
| 7 | vlib/v/checker/tests/undefined_ident_in_ref_selector.vv:6:15: error: `line` does not return a value |
| 8 | 4 | |
| 9 | 5 | fn read() int { |
| 10 | 6 | return &line.len |
| 11 | | ~~~ |
| 12 | 7 | } |
| 13 | vlib/v/checker/tests/undefined_ident_in_ref_selector.vv:6:9: error: cannot use `void` as type `int` in return argument |
| 14 | 4 | |
| 15 | 5 | fn read() int { |
| 16 | 6 | return &line.len |
| 17 | | ^ |
| 18 | 7 | } |
| 19 | vlib/v/checker/tests/undefined_ident_in_ref_selector.vv:6:9: error: fn `read` expects you to return a non reference type `int`, but you are returning `void` instead |
| 20 | 4 | |
| 21 | 5 | fn read() int { |
| 22 | 6 | return &line.len |
| 23 | | ^ |
| 24 | 7 | } |
| 25 | Details: use `return *pointer` instead of `return pointer`, and just `return value` instead of `return &value` |
| 26 | |