fix crash when compile error evaluating return...

...type of inferred error set. closes #1591
This commit is contained in:
Andrew Kelley
2018-09-26 16:59:08 -04:00
parent 589201b104
commit 1c26c2f4d5
3 changed files with 34 additions and 3 deletions

View File

@@ -1,6 +1,19 @@
const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
"compile error when evaluating return type of inferred error set",
\\const Car = struct {
\\ foo: *SymbolThatDoesNotExist,
\\ pub fn init() !Car {}
\\};
\\export fn entry() void {
\\ const car = Car.init();
\\}
,
".tmp_source.zig:2:11: error: use of undeclared identifier 'SymbolThatDoesNotExist'",
);
cases.add(
"don't implicit cast double pointer to *c_void",
\\export fn entry() void {