ir_resolve_const now checks recursivly for undef values

This commit is contained in:
Jimmi HC
2018-06-29 10:21:43 +02:00
parent b1128b18d5
commit 4c3f27ce1e
4 changed files with 160 additions and 2 deletions

View File

@@ -4124,4 +4124,19 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
,
".tmp_source.zig:3:36: error: @ArgType could not resolve the type of arg 0 because 'fn(var)var' is generic",
);
cases.add(
"Trying to pass undefined array to function taking comptime array by value",
\\fn a(comptime b: [2]u8) u8 { return b[0]; }
\\
\\test "" {
\\ const arr: [2]u8 = undefined;
\\ _ = a(arr);
\\}
,
".tmp_source.zig:5:11: error: use of undefined value",
);
}