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