Ignore type errors that have already been reported

This commit is contained in:
Richard Feldman 2021-09-18 02:47:39 -04:00
parent cde9f97415
commit a21ad7064c
6 changed files with 48 additions and 37 deletions

View file

@ -74,18 +74,19 @@ pub fn report_problems(loaded: &mut MonomorphizedModule) -> usize {
let problems = loaded.type_problems.remove(home).unwrap_or_default();
for problem in problems {
let report = type_problem(&alloc, module_path.clone(), problem);
let severity = report.severity;
let mut buf = String::new();
if let Some(report) = type_problem(&alloc, module_path.clone(), problem) {
let severity = report.severity;
let mut buf = String::new();
report.render_color_terminal(&mut buf, &alloc, &palette);
report.render_color_terminal(&mut buf, &alloc, &palette);
match severity {
Warning => {
warnings.push(buf);
}
RuntimeError => {
errors.push(buf);
match severity {
Warning => {
warnings.push(buf);
}
RuntimeError => {
errors.push(buf);
}
}
}
}