diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-21 21:21:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-21 21:21:05 -0400 |
| commit | be2a4c42bdfdbf9130eaeee3ce66085cb862dcd1 (patch) | |
| tree | 989e276143fcc59055202f234c7d2209b69ab6d5 /test | |
| parent | 5f38d6e2e97829ed74f06a96b5d07a2c68516063 (diff) | |
| parent | 459d72f8736ebd8372b9050c17e5f3bc00092573 (diff) | |
| download | zig-be2a4c42bdfdbf9130eaeee3ce66085cb862dcd1.tar.gz zig-be2a4c42bdfdbf9130eaeee3ce66085cb862dcd1.zip | |
Merge pull request #1149 from ziglang/issue346
fix compiler crash for invalid enum
Diffstat (limited to 'test')
| -rw-r--r-- | test/compile_errors.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 17896f9ab9..2247f0af96 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,19 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "enum field value references enum", + \\pub const Foo = extern enum { + \\ A = Foo.B, + \\ C = D, + \\}; + \\export fn entry() void { + \\ var s: Foo = Foo.E; + \\} + , + ".tmp_source.zig:1:17: error: 'Foo' depends on itself", + ); + + cases.add( "@floatToInt comptime safety", \\comptime { \\ _ = @floatToInt(i8, f32(-129.1)); |
