diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-08-20 18:35:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-20 18:35:31 -0400 |
| commit | 9cfcd0c29677e11f76846b006757ff49e05e3d6f (patch) | |
| tree | 285973ffaab76ee3ca831a9663f15be62c44d32b /test/compile_errors.zig | |
| parent | 1ca49b92c650e9b8988a35983e202cdb9c7ba6e7 (diff) | |
| parent | 717e2a365d9b5103f855668e4765cc154203a2bf (diff) | |
| download | zig-9cfcd0c29677e11f76846b006757ff49e05e3d6f.tar.gz zig-9cfcd0c29677e11f76846b006757ff49e05e3d6f.zip | |
Merge pull request #6103 from Vexu/extern
Disallow extern variables with initializers.
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index ea0d3b4e7b..ca75b2fa9c 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,12 @@ const tests = @import("tests.zig"); const std = @import("std"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.addTest("reject extern variables with initializers", + \\extern var foo: int = 2; + , &[_][]const u8{ + "tmp.zig:1:1: error: extern variables have no initializers", + }); + cases.addTest("duplicate/unused labels", \\comptime { \\ blk: { blk: while (false) {} } |
