| 1 | vlib/v/checker/tests/unimplemented_interface_e.vv:7:18: notice: unused parameter: `s` |
| 2 | 5 | struct Cat {} |
| 3 | 6 | |
| 4 | 7 | fn (c Cat) speak(s &string) {} |
| 5 | | ^ |
| 6 | 8 | |
| 7 | 9 | fn foo(a Animal) {} |
| 8 | vlib/v/checker/tests/unimplemented_interface_e.vv:9:8: notice: unused parameter: `a` |
| 9 | 7 | fn (c Cat) speak(s &string) {} |
| 10 | 8 | |
| 11 | 9 | fn foo(a Animal) {} |
| 12 | | ^ |
| 13 | 10 | |
| 14 | 11 | fn main() { |
| 15 | vlib/v/checker/tests/unimplemented_interface_e.vv:12:6: error: `Cat` incorrectly implements method `speak` of interface `Animal`: expected `string`, not `&string` for parameter 1 |
| 16 | 10 | |
| 17 | 11 | fn main() { |
| 18 | 12 | foo(Cat{}) |
| 19 | | ~~~~~ |
| 20 | 13 | _ = Animal(Cat{}) |
| 21 | 14 | } |
| 22 | Details: main.Animal has `fn speak(x main.Animal, s string)` |
| 23 | main.Cat has `fn speak(c main.Cat, s &string)` |
| 24 | vlib/v/checker/tests/unimplemented_interface_e.vv:13:6: error: `Cat` incorrectly implements method `speak` of interface `Animal`: expected `string`, not `&string` for parameter 1 |
| 25 | 11 | fn main() { |
| 26 | 12 | foo(Cat{}) |
| 27 | 13 | _ = Animal(Cat{}) |
| 28 | | ~~~~~~~~~~~~~ |
| 29 | 14 | } |
| 30 | Details: main.Animal has `fn speak(x main.Animal, s string)` |
| 31 | main.Cat has `fn speak(c main.Cat, s &string)` |
| 32 | vlib/v/checker/tests/unimplemented_interface_e.vv:13:6: error: `Cat` does not implement interface `Animal`, cannot cast `Cat` to interface `Animal` |
| 33 | 11 | fn main() { |
| 34 | 12 | foo(Cat{}) |
| 35 | 13 | _ = Animal(Cat{}) |
| 36 | | ~~~~~~~~~~~~~ |
| 37 | 14 | } |
| 38 | |