stage2: omit Decl compile errors from failed AstGen files

Just like when new parse errors occur during an update, when new AstGen
errors occur during an update, we do not reveal compile errors for Decl
objects which are inside of a newly failed File. Once the File passes
AstGen successfully, it will be compared with the previously succeeded
ZIR and the saved Decl compile errors will be handled properly.
This commit is contained in:
Andrew Kelley
2021-05-15 21:20:06 -07:00
parent dc036f5b6f
commit 7cd94d2123
3 changed files with 22 additions and 20 deletions

View File

@@ -1138,6 +1138,13 @@ pub const Scope = struct {
const loc = std.zig.findLineColumn(file.source.bytes, src);
std.debug.print("{s}:{d}:{d}\n", .{ file.sub_file_path, loc.line + 1, loc.column + 1 });
}
pub fn okToReportErrors(file: File) bool {
return switch (file.status) {
.parse_failure, .astgen_failure => false,
else => true,
};
}
};
/// This is the context needed to semantically analyze ZIR instructions and