From 34a3bc4196db302ea5b31c51b6d555336965be5f Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 May 2021 13:00:14 +0200 Subject: Paper over #8931 a bit more The problem was the skipping of binders in `resolve_method_call_as_callable`; this still doesn't use the _correct_ substitution, but at least it doesn't return a type with free variables in it. Fixes #8931. --- crates/hir/src/semantics.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/hir/src') diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index 38bd376bc..1b5064b5a 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)?; -- cgit v1.2.3