From c64f6f950343aef3c6d8fbffcff3ff4fc76960f4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 22 Sep 2016 10:40:05 -0400 Subject: fix compile crash when leaving out for loop parameter --- 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 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"); } ////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3