From 47d0cf201c3b88675ab940369b889a43b9197d6b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 9 Jul 2020 12:41:35 +0200 Subject: Don't emit diagnostic if there are type errors --- crates/ra_hir_ty/src/expr.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_hir_ty') diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/expr.rs index 7c3cd7952..f36304669 100644 --- a/crates/ra_hir_ty/src/expr.rs +++ b/crates/ra_hir_ty/src/expr.rs @@ -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]; -- cgit v1.2.3