add test case for previous commit

closes #2467
master
Andrew Kelley 2019-05-10 16:57:37 -04:00
parent fee0e6c8b9
commit 2933d6b848
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,16 @@ const tests = @import("tests.zig");
const builtin = @import("builtin");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
"peer cast then implicit cast const pointer to mutable C pointer",
\\export fn func() void {
\\ var strValue: [*c]u8 = undefined;
\\ strValue = strValue orelse c"";
\\}
,
"tmp.zig:3:32: error: cast discards const qualifier",
);
cases.add(
"attempt to cast enum literal to error",
\\export fn entry() void {