| ... | ... | @@ -7152,4 +7152,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 7152 | 7152 | ":39:29: error: slice-sentinel does not match target-sentinel", |
| 7153 | 7153 | ":46:29: error: slice-sentinel does not match target-sentinel", |
| 7154 | 7154 | }); |
| 7155 | |
| 7156 | cases.add("issue #4207: coerce from non-terminated-slice to terminated-pointer", |
| 7157 | \\export fn foo() [*:0]const u8 { |
| 7158 | \\ var buffer: [64]u8 = undefined; |
| 7159 | \\ return buffer[0..]; |
| 7160 | \\} |
| 7161 | , &[_][]const u8{ |
| 7162 | ":3:18: error: expected type '[*:0]const u8', found '*[64]u8'", |
| 7163 | ":3:18: note: destination pointer requires a terminating '0' sentinel", |
| 7164 | }); |
| 7155 | 7165 | } |