| 1 | export fn foo() void { |
| 2 | const ptr: [*]const u8 = "abc"; |
| 3 | _ = @as([]const u8, ptr); |
| 4 | } |
| 5 | export fn bar() void { |
| 6 | const ptr: [*c]const u8 = "def"; |
| 7 | _ = @as([]const u8, ptr); |
| 8 | } |
| 9 | export fn baz() void { |
| 10 | const ptr: *const u8 = &@as(u8, 123); |
| 11 | _ = @as([]const u8, ptr); |
| 12 | } |
| 13 | |
| 14 | // error |
| 15 | // |
| 16 | // :3:25: error: expected type '[]const u8', found '[*]const u8' |
| 17 | // :7:25: error: expected type '[]const u8', found '[*c]const u8' |
| 18 | // :11:25: error: expected type '[]const u8', found '*const u8' |