aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-08-28 15:39:32 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-08-28 15:39:32 -0400
commit901b5c1566a497822b98ba9327578839bac3df50 (patch)
treea086b61f7e6d4ee6b252c9c1ca037b48d77edee8 /test/compile_errors.zig
parent09cc1dc66067f378a1508e34c0714b659b445724 (diff)
downloadzig-901b5c1566a497822b98ba9327578839bac3df50.tar.gz
zig-901b5c1566a497822b98ba9327578839bac3df50.zip
add compile error for function prototype with no body
closes #1231
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index d0795c4550..5405b7b8a8 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -2,6 +2,16 @@ const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
+ "function protoype with no body",
+ \\fn foo() void;
+ \\export fn entry() void {
+ \\ foo();
+ \\}
+ ,
+ ".tmp_source.zig:1:1: error: non-extern function has no body",
+ );
+
+ cases.add(
"@typeInfo causing depend on itself compile error",
\\const start = struct {
\\ fn crash() bug() {