aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-02 00:09:49 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-02 00:09:49 -0700
commit724dcdd384c6c00b9e39ed67867d364287e45f0a (patch)
tree42e617f280fc3016933ad8197b32d82efede1ed6 /test/run_tests.cpp
parent9a8851515b8aeac1adcea38094a45e3260e7522c (diff)
downloadzig-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.cpp6
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) {