From 724dcdd384c6c00b9e39ed67867d364287e45f0a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 2 Jan 2016 00:09:49 -0700 Subject: error for if var expression not maybe type --- test/run_tests.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/run_tests.cpp') 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) { -- cgit v1.2.3