| ... | ... | @@ -2,6 +2,16 @@ const tests = @import("tests.zig"); |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | |
| 4 | 4 | pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5 | cases.add( |
| 6 | "empty switch on an integer", |
| 7 | \\export fn entry() void { |
| 8 | \\ var x: u32 = 0; |
| 9 | \\ switch(x) {} |
| 10 | \\} |
| 11 | , |
| 12 | "tmp.zig:3:5: error: switch must handle all possibilities", |
| 13 | ); |
| 14 | |
| 5 | 15 | cases.add( |
| 6 | 16 | "regression test #2980: base type u32 is not type checked properly when assigning a value within a struct", |
| 7 | 17 | \\const Foo = struct { |