From 2bb2e61ee288a02e184e5b8422859a4afcbb4813 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 28 Jan 2016 18:58:28 -0700 Subject: parser: allow missing fn name and missing param names now these problems are caught in analyzer this is for purpose of function type, see #14 --- test/run_tests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/run_tests.cpp') diff --git a/test/run_tests.cpp b/test/run_tests.cpp index f41e44562a..940c92769c 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1859,6 +1859,13 @@ fn f(foo: Foo, index: i32) { const result = members[index](); } )SOURCE", 1, ".tmp_source.zig:21:34: error: expected 1 arguments, got 0"); + + add_compile_fail_case("missing function name and param name", R"SOURCE( +fn () {} +fn f(i32) {} + )SOURCE", 2, + ".tmp_source.zig:2:1: error: missing function name", + ".tmp_source.zig:3:6: error: missing parameter name"); } ////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3