master
1export fn entry1() void {
2 const p: **u32 = undefined;
3 const q: **i32 = p;
4 _ = q;
5}
6
7export fn entry2() void {
8 const p: [*]*u32 = undefined;
9 const q: [*]*i32 = p;
10 _ = q;
11}
12
13export fn entry3() void {
14 const p: []*u32 = undefined;
15 const q: []*i32 = p;
16 _ = q;
17}
18
19export fn entry4() void {
20 const p: [*c]*u32 = undefined;
21 const q: [*c]*i32 = p;
22 _ = q;
23}
24
25export fn entry5() void {
26 const p: **[1:42]u8 = undefined;
27 const q: **[1]u8 = p;
28 _ = q;
29}
30
31// error
32//
33// :3:22: error: expected type '**i32', found '**u32'
34// :3:22: note: pointer type child '*u32' cannot cast into pointer type child '*i32'
35// :3:22: note: pointer type child 'u32' cannot cast into pointer type child 'i32'
36// :3:22: note: signed 32-bit int cannot represent all possible unsigned 32-bit values
37// :9:24: error: expected type '[*]*i32', found '[*]*u32'
38// :9:24: note: pointer type child '*u32' cannot cast into pointer type child '*i32'
39// :9:24: note: pointer type child 'u32' cannot cast into pointer type child 'i32'
40// :9:24: note: signed 32-bit int cannot represent all possible unsigned 32-bit values
41// :15:23: error: expected type '[]*i32', found '[]*u32'
42// :15:23: note: pointer type child '*u32' cannot cast into pointer type child '*i32'
43// :15:23: note: pointer type child 'u32' cannot cast into pointer type child 'i32'
44// :15:23: note: signed 32-bit int cannot represent all possible unsigned 32-bit values
45// :21:25: error: expected type '[*c]*i32', found '[*c]*u32'
46// :21:25: note: pointer type child '*u32' cannot cast into pointer type child '*i32'
47// :21:25: note: pointer type child 'u32' cannot cast into pointer type child 'i32'
48// :21:25: note: signed 32-bit int cannot represent all possible unsigned 32-bit values
49// :27:24: error: expected type '**[1]u8', found '**[1:42]u8'
50// :27:24: note: pointer type child '*[1:42]u8' cannot cast into pointer type child '*[1]u8'
51// :27:24: note: pointer type child '[1:42]u8' cannot cast into pointer type child '[1]u8'
52// :27:24: note: source array cannot be guaranteed to maintain '42' sentinel