diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-05-09 13:44:29 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-05-09 13:44:29 -0700 |
| commit | f1e5be96860406d7a4239b174c896799d8fd6545 (patch) | |
| tree | 4b322fa179f2eaca32664d415a4c069777bd3e7f /test/run_tests.cpp | |
| parent | 745c325d0f498406f229e532753e5d5712e824d4 (diff) | |
| download | zig-f1e5be96860406d7a4239b174c896799d8fd6545.tar.gz zig-f1e5be96860406d7a4239b174c896799d8fd6545.zip | |
fix ability to use previous generic params and
add error when `%return` shows up in a function with incorrect
return type
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index aee5fe17fe..d927e743c8 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1382,6 +1382,15 @@ fn f() { } )SOURCE", 1, ".tmp_source.zig:4:19: error: type 'i8' has same or fewer bits than destination type 'i8'"); + add_compile_fail_case("truncate same bit count", R"SOURCE( +fn f() { + %return something(); +} +fn something() -> %void { } + )SOURCE", 2, + ".tmp_source.zig:3:5: error: %return statement in function with return type 'void'", + ".tmp_source.zig:2:8: note: function return type here"); + } ////////////////////////////////////////////////////////////////////////////// |
