From 0f7f1f070584fbdc07a10df47b95b147698551fd Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 2 May 2021 16:32:42 +0200 Subject: Temporary fix for unknown expectations --- crates/hir_ty/src/infer/coerce.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/hir_ty/src/infer') diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index c82bda70f..8467ea056 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs @@ -19,6 +19,10 @@ impl<'a> InferenceContext<'a> { /// Unify two types, but may coerce the first one to the second one /// using "implicit coercion rules" if needed. pub(super) fn coerce(&mut self, from_ty: &Ty, to_ty: &Ty) -> bool { + // TODO handle expectations properly + if to_ty.is_unknown() { + return true; + } let from_ty = self.resolve_ty_shallow(from_ty).into_owned(); let to_ty = self.resolve_ty_shallow(to_ty); match self.coerce_inner(from_ty, &to_ty) { -- cgit v1.2.3