v2 / vlib / v / checker / tests / cast_voidptr_to_struct_alias_err.out
34 lines · 34 sloc · 1.72 KB · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1vlib/v/checker/tests/cast_voidptr_to_struct_alias_err.vv:20:6: error: cannot cast `voidptr` to `AliasFoo1` (alias to `C.Foo1`)
2 18 | fn main() {
3 19 | // test cast `voidptr/nil` to `alias`
4 20 | _ = AliasFoo1(unsafe { nil })
5 | ~~~~~~~~~~~~~~~~~~~~~~~~~
6 21 | _ = AliasFoo2(unsafe { nil })
7 22 | _ = AliasBar(unsafe { nil })
8vlib/v/checker/tests/cast_voidptr_to_struct_alias_err.vv:21:6: error: cannot cast `voidptr` to `AliasFoo2` (alias to `C.Foo2`)
9 19 | // test cast `voidptr/nil` to `alias`
10 20 | _ = AliasFoo1(unsafe { nil })
11 21 | _ = AliasFoo2(unsafe { nil })
12 | ~~~~~~~~~~~~~~~~~~~~~~~~~
13 22 | _ = AliasBar(unsafe { nil })
14 23 |
15vlib/v/checker/tests/cast_voidptr_to_struct_alias_err.vv:22:6: error: cannot cast `voidptr` to `AliasBar` (alias to `Bar`)
16 20 | _ = AliasFoo1(unsafe { nil })
17 21 | _ = AliasFoo2(unsafe { nil })
18 22 | _ = AliasBar(unsafe { nil })
19 | ~~~~~~~~~~~~~~~~~~~~~~~~
20 23 |
21 24 | // test cast `voidptr/nil` to `non-alias` and has `typedef`
22vlib/v/checker/tests/cast_voidptr_to_struct_alias_err.vv:25:8: error: cannot cast `voidptr` to struct
23 23 |
24 24 | // test cast `voidptr/nil` to `non-alias` and has `typedef`
25 25 | _ = C.Foo1(unsafe { nil })
26 | ~~~~~~~~~~~~~~~~~~~~
27 26 | // test cast `voidptr/nil` to `non-alias` and no `typedef`
28 27 | _ = C.Foo2(unsafe { nil })
29vlib/v/checker/tests/cast_voidptr_to_struct_alias_err.vv:27:8: error: cannot cast `voidptr` to struct
30 25 | _ = C.Foo1(unsafe { nil })
31 26 | // test cast `voidptr/nil` to `non-alias` and no `typedef`
32 27 | _ = C.Foo2(unsafe { nil })
33 | ~~~~~~~~~~~~~~~~~~~~
34 28 | }
35