diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index 38bd376bc0..1b5064b5a2 100644 --- a/crates/hir/src/semantics.rs +++ b/crates/hir/src/semantics.rs @@ -505,9 +505,10 @@ impl<'db> SemanticsImpl<'db> { } fn resolve_method_call_as_callable(&self, call: &ast::MethodCallExpr) -> Option { - // FIXME: this erases Substs + // FIXME: this erases Substs, we should instead record the correct + // substitution during inference and use that let func = self.resolve_method_call(call)?; - let (ty, _) = self.db.value_ty(func.into()).into_value_and_skipped_binders(); + let ty = hir_ty::TyBuilder::value_ty(self.db, func.into()).fill_with_unknown().build(); let resolver = self.analyze(call.syntax()).resolver; let ty = Type::new_with_resolver(self.db, &resolver, ty)?; let mut res = ty.as_callable(self.db)?; diff --git a/crates/ide_completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs index 1bff559365..fd97387437 100644 --- a/crates/ide_completion/src/completions/dot.rs +++ b/crates/ide_completion/src/completions/dot.rs @@ -480,6 +480,7 @@ impl S { } "#, expect![[r#" + me foo() fn(&self) -> &[u8] "#]], ); }