Add missing compile error when ptr used instead of array
in array literals. Fixes #3524
This commit is contained in:
@@ -2,6 +2,19 @@ const tests = @import("tests.zig");
|
||||
const builtin = @import("builtin");
|
||||
|
||||
pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
cases.add(
|
||||
"using an unknown len ptr type instead of array",
|
||||
\\const resolutions = [*][*]const u8{
|
||||
\\ c"[320 240 ]",
|
||||
\\ null,
|
||||
\\};
|
||||
\\comptime {
|
||||
\\ _ = resolutions;
|
||||
\\}
|
||||
,
|
||||
"tmp.zig:1:21: error: expected array type or [_], found '[*][*]const u8'",
|
||||
);
|
||||
|
||||
cases.add(
|
||||
"comparison with error union and error value",
|
||||
\\export fn entry() void {
|
||||
|
||||
Reference in New Issue
Block a user