diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-02 00:09:49 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-02 00:09:49 -0700 |
| commit | 724dcdd384c6c00b9e39ed67867d364287e45f0a (patch) | |
| tree | 42e617f280fc3016933ad8197b32d82efede1ed6 /test/run_tests.cpp | |
| parent | 9a8851515b8aeac1adcea38094a45e3260e7522c (diff) | |
| download | zig-724dcdd384c6c00b9e39ed67867d364287e45f0a.tar.gz zig-724dcdd384c6c00b9e39ed67867d364287e45f0a.zip | |
error for if var expression not maybe type
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 5c3e5f5257..973c158705 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -982,6 +982,12 @@ fn f() { continue; } )SOURCE", 1, ".tmp_source.zig:3:5: error: 'continue' expression not in loop"); + + add_compile_fail_case("invalid maybe type", R"SOURCE( +fn f() { + if (const x ?= true) { } +} + )SOURCE", 1, ".tmp_source.zig:3:20: error: expected maybe type"); } static void print_compiler_invocation(TestCase *test_case) { |
