aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-07-09 11:41:35 +0100
committerJonas Schievink <[email protected]>2020-07-09 11:41:35 +0100
commit47d0cf201c3b88675ab940369b889a43b9197d6b (patch)
tree609b67ab079e0c9513f7055bb77300bf98be5589 /crates
parent63ce2c7b5fd96e6688796f2ddd1cd7316df8d11d (diff)
Don't emit diagnostic if there are type errors
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir_ty/src/expr.rs7
1 files changed, 7 insertions, 0 deletions
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> {
150 150
151 fn validate_call(&mut self, db: &dyn HirDatabase, call_id: ExprId, expr: &Expr) -> Option<()> { 151 fn validate_call(&mut self, db: &dyn HirDatabase, call_id: ExprId, expr: &Expr) -> Option<()> {
152 // Check that the number of arguments matches the number of parameters. 152 // Check that the number of arguments matches the number of parameters.
153
154 // Due to shortcomings in the current type system implementation, only emit this diagnostic
155 // if there are no type mismatches in the containing function.
156 if self.infer.type_mismatches.iter().next().is_some() {
157 return Some(());
158 }
159
153 let (callee, args) = match expr { 160 let (callee, args) = match expr {
154 Expr::Call { callee, args } => { 161 Expr::Call { callee, args } => {
155 let callee = &self.infer.type_of_expr[*callee]; 162 let callee = &self.infer.type_of_expr[*callee];