| ... | @@ -3,6 +3,12 @@ const builtin = @import("builtin"); | ... | @@ -3,6 +3,12 @@ const builtin = @import("builtin"); |
| 3 | const Target = @import("std").Target; | 3 | const Target = @import("std").Target; |
| 4 | | 4 | |
| 5 | pub fn addCases(cases: *tests.CompileErrorContext) void { | 5 | pub fn addCases(cases: *tests.CompileErrorContext) void { |
| | 6 | cases.addTest("dependency loop in top-level decl with @TypeInfo", |
| | 7 | \\export const foo = @typeInfo(@This()); |
| | 8 | , &[_][]const u8{ |
| | 9 | "tmp.zig:1:20: error: dependency loop detected", |
| | 10 | }); |
| | 11 | |
| 6 | cases.add("function call assigned to incorrect type", | 12 | cases.add("function call assigned to incorrect type", |
| 7 | \\export fn entry() void { | 13 | \\export fn entry() void { |
| 8 | \\ var arr: [4]f32 = undefined; | 14 | \\ var arr: [4]f32 = undefined; |
| ... | @@ -27,12 +33,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { | ... | @@ -27,12 +33,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 27 | "tmp.zig:3:18: error: expected type '[]i32', found 'anyerror!i32", | 33 | "tmp.zig:3:18: error: expected type '[]i32', found 'anyerror!i32", |
| 28 | }); | 34 | }); |
| 29 | | 35 | |
| 30 | cases.addTest("dependency loop in top-level decl with @TypeInfo", | | |
| 31 | \\export const foo = @typeInfo(@This()); | | |
| 32 | , &[_][]const u8{ | | |
| 33 | "tmp.zig:1:20: error: dependency loop detected", | | |
| 34 | }); | | |
| 35 | | | |
| 36 | cases.addTest("non-exhaustive enums", | 36 | cases.addTest("non-exhaustive enums", |
| 37 | \\const A = enum { | 37 | \\const A = enum { |
| 38 | \\ a, | 38 | \\ a, |