v2 / vlib / v / checker / tests / cannot_cast_to_struct.out
41 lines · 41 sloc · 1.48 KB · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1vlib/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)
8vlib/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)
15vlib/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{}
22vlib/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{}
29vlib/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)
36vlib/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