diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-15 19:05:51 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-15 19:05:51 -0700 |
| commit | 8bc3fae1cf055e33e01e0cbbbbc67f307f60b95b (patch) | |
| tree | 1fc0b4b9b4955d94e96e5bccef733afe2ec25a9f /test | |
| parent | 8818c59cbc96e6b0699a408d2fbaa9846356d85a (diff) | |
| download | zig-8bc3fae1cf055e33e01e0cbbbbc67f307f60b95b.tar.gz zig-8bc3fae1cf055e33e01e0cbbbbc67f307f60b95b.zip | |
fix error message for struct initialization on array
Diffstat (limited to 'test')
| -rw-r--r-- | test/run_tests.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index d8bb9b51d9..0c6669b8c4 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1419,6 +1419,10 @@ const b : @typeof(a) = 0; add_compile_fail_case("noalias on non pointer param", R"SOURCE( fn f(noalias x: i32) => {} )SOURCE", 1, ".tmp_source.zig:2:6: error: noalias on non-pointer parameter"); + + add_compile_fail_case("struct init syntax for array", R"SOURCE( +const foo = []u16{.x = 1024,}; + )SOURCE", 1, ".tmp_source.zig:2:18: error: type '[]u16' does not support struct initialization syntax"); } static void print_compiler_invocation(TestCase *test_case) { |
