aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-08-31 16:30:46 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-08-31 16:30:46 -0400
commit67b6dd28ec70937a29176719b56457ee17b1c136 (patch)
treecf6e7e1585d8cb1b56ba77ec53562f7502c5e65d /test/compile_errors.zig
parenteb0979189be33d6d957dad5104650cb5c532055b (diff)
downloadzig-67b6dd28ec70937a29176719b56457ee17b1c136.tar.gz
zig-67b6dd28ec70937a29176719b56457ee17b1c136.zip
allow array literals to have size and fix comptime bug
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index cd6b0be8cd..81d1361aec 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -2061,4 +2061,11 @@ pub fn addCases(cases: &tests.CompileErrorContext) {
,
".tmp_source.zig:4:23: error: expected pointer alignment of at least 4, found 1");
+ cases.add("wrong size to an array literal",
+ \\comptime {
+ \\ const array = [2]u8{1, 2, 3};
+ \\}
+ ,
+ ".tmp_source.zig:2:24: error: expected [2]u8 literal, found [3]u8 literal");
+
}