internal: refactor mismatched args count diagnostic

This commit is contained in:
Aleksey Kladov 2021-06-13 20:06:25 +03:00
parent bccf77f26c
commit 8d391ec981
4 changed files with 279 additions and 280 deletions

View file

@ -1176,12 +1176,9 @@ impl Function {
}
BodyValidationDiagnostic::MismatchedArgCount { call_expr, expected, found } => {
match source_map.expr_syntax(call_expr) {
Ok(source_ptr) => sink.push(MismatchedArgCount {
file: source_ptr.file_id,
call_expr: source_ptr.value,
expected,
found,
}),
Ok(source_ptr) => acc.push(
MismatchedArgCount { call_expr: source_ptr, expected, found }.into(),
),
Err(SyntheticSyntax) => (),
}
}