mirror of
https://github.com/ziglang/zig.git
synced 2026-02-18 07:18:38 +00:00
add compiler-error test: coerce
Issue fixed by an unknown commit. closes #4207
This commit is contained in:
parent
db4c06ce60
commit
8b6a06eefe
@ -7152,4 +7152,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
":39:29: error: slice-sentinel does not match target-sentinel",
|
||||
":46:29: error: slice-sentinel does not match target-sentinel",
|
||||
});
|
||||
|
||||
cases.add("issue #4207: coerce from non-terminated-slice to terminated-pointer",
|
||||
\\export fn foo() [*:0]const u8 {
|
||||
\\ var buffer: [64]u8 = undefined;
|
||||
\\ return buffer[0..];
|
||||
\\}
|
||||
, &[_][]const u8{
|
||||
":3:18: error: expected type '[*:0]const u8', found '*[64]u8'",
|
||||
":3:18: note: destination pointer requires a terminating '0' sentinel",
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user