Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer.rs')
| -rw-r--r-- | crates/hir-ty/src/infer.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs index 336de14282..0c7529cffe 100644 --- a/crates/hir-ty/src/infer.rs +++ b/crates/hir-ty/src/infer.rs @@ -170,6 +170,7 @@ pub enum InferenceDiagnostic { // FIXME: Make this proper BreakOutsideOfLoop { expr: ExprId, is_break: bool, bad_value_break: bool }, MismatchedArgCount { call_expr: ExprId, expected: usize, found: usize }, + ExpectedFunction { call_expr: ExprId, found: Ty }, } /// A mismatch between an expected and an inferred type. @@ -505,6 +506,14 @@ impl<'a> InferenceContext<'a> { mismatch.expected = table.resolve_completely(mismatch.expected.clone()); mismatch.actual = table.resolve_completely(mismatch.actual.clone()); } + for diagnostic in &mut result.diagnostics { + match diagnostic { + InferenceDiagnostic::ExpectedFunction { found, .. } => { + *found = table.resolve_completely(found.clone()) + } + _ => (), + } + } for (_, subst) in result.method_resolutions.values_mut() { *subst = table.resolve_completely(subst.clone()); } |