aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-28 18:58:28 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-28 18:58:28 -0700
commit2bb2e61ee288a02e184e5b8422859a4afcbb4813 (patch)
treef7b77f8ce8837d9909250b9dec3326d963976d6d /test
parentff028525e5421ee93182bbf19102d34d434286f3 (diff)
downloadzig-2bb2e61ee288a02e184e5b8422859a4afcbb4813.tar.gz
zig-2bb2e61ee288a02e184e5b8422859a4afcbb4813.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/run_tests.cpp7
1 files changed, 7 insertions, 0 deletions
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");
}
//////////////////////////////////////////////////////////////////////////////