aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-05 21:21:59 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-05 21:21:59 -0400
commit6632d85e5f1120784b3eb0a7ab8be0792ba27b85 (patch)
treec9665957482dcb85e70ab9dd17954dfacb0d6961 /test/compile_errors.zig
parent1d8b8ad687facd25a27b3ff6d083812b45cd529f (diff)
downloadzig-6632d85e5f1120784b3eb0a7ab8be0792ba27b85.tar.gz
zig-6632d85e5f1120784b3eb0a7ab8be0792ba27b85.zip
stage1: improve handling of generic fn proto type expr
closes #902
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 24d977c218..faf17d2c05 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -2,6 +2,17 @@ const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
+ "refer to the type of a generic function",
+ \\export fn entry() void {
+ \\ const Func = fn (type) void;
+ \\ const f: Func = undefined;
+ \\ f(i32);
+ \\}
+ ,
+ ".tmp_source.zig:4:5: error: use of undefined value",
+ );
+
+ cases.add(
"accessing runtime parameter from outer function",
\\fn outer(y: u32) fn (u32) u32 {
\\ const st = struct {