pass unreachable variable test

master
Andrew Kelley 2017-01-05 04:03:25 -05:00
parent 438feebbcf
commit ed21be011a
1 changed files with 2 additions and 2 deletions

View File

@ -771,11 +771,11 @@ fn f() {
fn f() { fn f() {
const a = return; const a = return;
} }
)SOURCE", 1, ".tmp_source.zig:3:5: error: variable initialization is unreachable"); )SOURCE", 1, ".tmp_source.zig:3:5: error: unreachable code");
add_compile_fail_case("unreachable variable", R"SOURCE( add_compile_fail_case("unreachable variable", R"SOURCE(
fn f() { fn f() {
const a : unreachable = return; const a : unreachable = {};
} }
)SOURCE", 1, ".tmp_source.zig:3:15: error: variable of type 'unreachable' not allowed"); )SOURCE", 1, ".tmp_source.zig:3:15: error: variable of type 'unreachable' not allowed");