aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-05-02 15:32:42 +0100
committerFlorian Diebold <[email protected]>2021-05-21 16:48:34 +0100
commit0f7f1f070584fbdc07a10df47b95b147698551fd (patch)
treeb4357b736c7d068863f56a5d9b6308ccb739938b /crates/hir_ty/src/infer
parent4ca1981c9149fe602b548d1d3629c0cc312d30f7 (diff)
Temporary fix for unknown expectations
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r--crates/hir_ty/src/infer/coerce.rs4
1 files changed, 4 insertions, 0 deletions
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> {
19 /// Unify two types, but may coerce the first one to the second one 19 /// Unify two types, but may coerce the first one to the second one
20 /// using "implicit coercion rules" if needed. 20 /// using "implicit coercion rules" if needed.
21 pub(super) fn coerce(&mut self, from_ty: &Ty, to_ty: &Ty) -> bool { 21 pub(super) fn coerce(&mut self, from_ty: &Ty, to_ty: &Ty) -> bool {
22 // TODO handle expectations properly
23 if to_ty.is_unknown() {
24 return true;
25 }
22 let from_ty = self.resolve_ty_shallow(from_ty).into_owned(); 26 let from_ty = self.resolve_ty_shallow(from_ty).into_owned();
23 let to_ty = self.resolve_ty_shallow(to_ty); 27 let to_ty = self.resolve_ty_shallow(to_ty);
24 match self.coerce_inner(from_ty, &to_ty) { 28 match self.coerce_inner(from_ty, &to_ty) {