aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-05 09:26:39 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-05 09:26:39 -0500
commit44d8d654a0ba463a1d4cf34d435c8422bfcd1c81 (patch)
tree8ef92e3af15a5daf359163d46404171695ae89a1 /test/compile_errors.zig
parentec59f765266749a29d5ba1804f4ab5afdcabee1d (diff)
downloadzig-44d8d654a0ba463a1d4cf34d435c8422bfcd1c81.tar.gz
zig-44d8d654a0ba463a1d4cf34d435c8422bfcd1c81.zip
fix test failure, organize code, add new compile error
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 3267ea7435..92066d7e0e 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -1,6 +1,12 @@
const tests = @import("tests.zig");
pub fn addCases(cases: &tests.CompileErrorContext) void {
+ cases.add("cast negative integer literal to usize",
+ \\export fn entry() void {
+ \\ const x = usize(-10);
+ \\}
+ , ".tmp_source.zig:2:21: error: cannot cast negative value -10 to unsigned integer type 'usize'");
+
cases.add("use invalid number literal as array index",
\\var v = 25;
\\export fn entry() void {