aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-09-22 10:40:05 -0400
committerAndrew Kelley <superjoe30@gmail.com>2016-09-22 10:40:05 -0400
commitc64f6f950343aef3c6d8fbffcff3ff4fc76960f4 (patch)
tree0f78240a470d92662218dd932eabf41a7c3b98f2 /test
parent7aeca9bfed654f7f5d0e4b9775459b878f4726ed (diff)
downloadzig-c64f6f950343aef3c6d8fbffcff3ff4fc76960f4.tar.gz
zig-c64f6f950343aef3c6d8fbffcff3ff4fc76960f4.zip
fix compile crash when leaving out for loop parameter
Diffstat (limited to 'test')
-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 a7085a48af..bbf1fd2168 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1495,6 +1495,12 @@ pub fn f() {
add_compile_fail_case("main function with bogus args type", R"SOURCE(
pub fn main(args: [][]bogus) -> %void {}
)SOURCE", 1, ".tmp_source.zig:2:23: error: use of undeclared identifier 'bogus'");
+
+ add_compile_fail_case("main function with bogus args type", R"SOURCE(
+fn foo(blah: []u8) {
+ for (blah) { }
+}
+ )SOURCE", 1, ".tmp_source.zig:3:16: error: for loop expression missing element parameter");
}
//////////////////////////////////////////////////////////////////////////////