authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-04-03 19:11:51-04:00
committergravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-04-03 19:11:51-04:00
log8b6a06eefe8738896a6657c86af5770250e0b67a
tree114d9538a30d29fe39cf133cabbe810a9f758d89
parentdb4c06ce606dcfe989b5c1f76d5ed00e90d5dd9f
signaturelock-open Commit is signed but in an unrecognized format.

add compiler-error test: coerce

Issue fixed by an unknown commit. closes #4207

1 files changed, 10 insertions(+), 0 deletions(-)

test/compile_errors.zig+10
......@@ -7152,4 +7152,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
71527152 ":39:29: error: slice-sentinel does not match target-sentinel",
71537153 ":46:29: error: slice-sentinel does not match target-sentinel",
71547154 });
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 });
71557165}