Skip to main content

split_broken_decl_echoes

Function split_broken_decl_echoes 

Source
pub fn split_broken_decl_echoes(
    resolve_errors: Vec<CompileError>,
    broken_decl_names: &[String],
) -> (Vec<CompileError>, Vec<CompileError>)
Expand description

#1663 (Decision B): split resolve errors into those to report and those that only echo a declaration the parser had to skip.

A declaration that fails to parse is dropped from the AST, so every reference to its name — Money in a signature, Money.zero as a method’s owner, a call to a skipped fn — resolves as unknown, and one missing comma becomes twenty diagnostics. Its name is known (the parser recorded it in broken_decl_names); only its declaration is broken, and that is already reported. So an unknown-name diagnostic naming one is hidden.

The hidden errors still count as resolve errors: pass both halves to without_resolve_echoes, so the declarations they are in reject the checker’s follow-on diagnostics too.