| 1 | vlib/v/checker/tests/cannot_cast_to_struct.vv:12:7: warning: casting to struct is deprecated, use e.g. `Struct{...expr}` instead |
| 2 | 10 | |
| 3 | 11 | fn main() { |
| 4 | 12 | _ := Test(Abc{}) |
| 5 | | ~~~~~~~~~~~ |
| 6 | 13 | sum := Alphabet(Xyz{}) |
| 7 | 14 | _ = Xyz(sum) |
| 8 | vlib/v/checker/tests/cannot_cast_to_struct.vv:12:7: error: cannot convert struct `Abc` to struct `Test` |
| 9 | 10 | |
| 10 | 11 | fn main() { |
| 11 | 12 | _ := Test(Abc{}) |
| 12 | | ~~~~~~~~~~~ |
| 13 | 13 | sum := Alphabet(Xyz{}) |
| 14 | 14 | _ = Xyz(sum) |
| 15 | vlib/v/checker/tests/cannot_cast_to_struct.vv:14:6: error: cannot cast `Alphabet` to struct |
| 16 | 12 | _ := Test(Abc{}) |
| 17 | 13 | sum := Alphabet(Xyz{}) |
| 18 | 14 | _ = Xyz(sum) |
| 19 | | ~~~~~~~~ |
| 20 | 15 | _ = Xyz(5) |
| 21 | 16 | s := Abc{} |
| 22 | vlib/v/checker/tests/cannot_cast_to_struct.vv:14:6: error: cannot cast `Alphabet` sum type value to `Xyz`, use `sum as Xyz` instead |
| 23 | 12 | _ := Test(Abc{}) |
| 24 | 13 | sum := Alphabet(Xyz{}) |
| 25 | 14 | _ = Xyz(sum) |
| 26 | | ~~~~~~~~ |
| 27 | 15 | _ = Xyz(5) |
| 28 | 16 | s := Abc{} |
| 29 | vlib/v/checker/tests/cannot_cast_to_struct.vv:15:6: error: cannot cast `int literal` to struct |
| 30 | 13 | sum := Alphabet(Xyz{}) |
| 31 | 14 | _ = Xyz(sum) |
| 32 | 15 | _ = Xyz(5) |
| 33 | | ~~~~~~ |
| 34 | 16 | s := Abc{} |
| 35 | 17 | _ = Xyz(&s) |
| 36 | vlib/v/checker/tests/cannot_cast_to_struct.vv:17:6: error: cannot cast `&Abc` to struct |
| 37 | 15 | _ = Xyz(5) |
| 38 | 16 | s := Abc{} |
| 39 | 17 | _ = Xyz(&s) |
| 40 | | ~~~~~~~ |
| 41 | 18 | } |
| 42 | |