update std lib to decls being disallowed between fields

This commit is contained in:
Vexu
2020-04-18 19:44:59 +03:00
parent fff00c3bbb
commit b6fe839248
10 changed files with 103 additions and 42 deletions

View File

@@ -4,17 +4,20 @@ const std = @import("std");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add("declaration between fields",
\\const S = struct {
\\ a: usize,
\\ const foo = 2;
\\ const bar = 2;
\\ const baz = 2;
\\ a: usize,
\\ const foo1 = 2;
\\ const bar1 = 2;
\\ const baz1 = 2;
\\ b: usize,
\\};
\\comptime {
\\ _ = S;
\\}
, &[_][]const u8{
"tmp.zig:3:5: error: declarations are not allowed between container fields",
"tmp.zig:6:5: error: declarations are not allowed between container fields",
});
cases.add("non-extern function with var args",