mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Don't emit diagnostic if there are type errors
This commit is contained in:
parent
63ce2c7b5f
commit
47d0cf201c
1 changed files with 7 additions and 0 deletions
|
@ -150,6 +150,13 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
|
|||
|
||||
fn validate_call(&mut self, db: &dyn HirDatabase, call_id: ExprId, expr: &Expr) -> Option<()> {
|
||||
// Check that the number of arguments matches the number of parameters.
|
||||
|
||||
// Due to shortcomings in the current type system implementation, only emit this diagnostic
|
||||
// if there are no type mismatches in the containing function.
|
||||
if self.infer.type_mismatches.iter().next().is_some() {
|
||||
return Some(());
|
||||
}
|
||||
|
||||
let (callee, args) = match expr {
|
||||
Expr::Call { callee, args } => {
|
||||
let callee = &self.infer.type_of_expr[*callee];
|
||||
|
|
Loading…
Reference in a new issue