Update compile-errors test for @Type(.Struct)

This commit is contained in:
Tadeo Kondrak 2020-08-19 15:26:03 -06:00
parent b46d764fd9
commit 759485cc32
No known key found for this signature in database
GPG Key ID: D41E092CA43F1D8B

View File

@ -1395,12 +1395,12 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
"tmp.zig:3:36: error: expected type 'std.builtin.TypeInfo', found 'std.builtin.Int'",
});
cases.add("Struct unavailable for @Type",
cases.add("struct with declarations unavailable for @Type",
\\export fn entry() void {
\\ _ = @Type(@typeInfo(struct { }));
\\ _ = @Type(@typeInfo(struct { const foo = 1; }));
\\}
, &[_][]const u8{
"tmp.zig:2:15: error: @Type not available for 'TypeInfo.Struct'",
"tmp.zig:2:15: error: TypeInfo.Struct.decls must be empty for @Type",
});
cases.add("wrong type for argument tuple to @asyncCall",