aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-05 10:43:35 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-05 10:43:35 -0400
commita76a72469bf5980946fad8f8e60f07edde543ce5 (patch)
tree8a4f5bba088b64e26d13c0e509bfd66ba3d64224 /test/compile_errors.zig
parent3e94650ef7bd2407fb0aca11ad19a93b90a14b7c (diff)
downloadzig-a76a72469bf5980946fad8f8e60f07edde543ce5.tar.gz
zig-a76a72469bf5980946fad8f8e60f07edde543ce5.zip
stage1: fix crash when invalid type used in array type
closes #1186
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 62aa7d46f2..f89dea1921 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -2,6 +2,19 @@ const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
+ "invalid type used in array type",
+ \\const Item = struct {
+ \\ field: SomeNonexistentType,
+ \\};
+ \\var items: [100]Item = undefined;
+ \\export fn entry() void {
+ \\ const a = items[0];
+ \\}
+ ,
+ ".tmp_source.zig:2:12: error: use of undeclared identifier 'SomeNonexistentType'",
+ );
+
+ cases.add(
"@noInlineCall on an inline function",
\\inline fn foo() void {}
\\