diff options
author | Florian Diebold <[email protected]> | 2021-05-21 16:41:20 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-05-21 17:23:03 +0100 |
commit | 556c9cebdb91278702263df4ac8c99ec24ab331a (patch) | |
tree | d1895aa19a6ec1b7532871e171f1c37870298f58 /crates/hir_ty/src/infer/coerce.rs | |
parent | 99c73537faba59c881805573442562418e0b650a (diff) |
Refactor expectation handling
So as to not use `TyKind::Error` as "no expectation".
Diffstat (limited to 'crates/hir_ty/src/infer/coerce.rs')
-rw-r--r-- | crates/hir_ty/src/infer/coerce.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index 20c512517..03dd6ae76 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs | |||
@@ -21,10 +21,6 @@ impl<'a> InferenceContext<'a> { | |||
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 | let from_ty = self.resolve_ty_shallow(from_ty); | 22 | let from_ty = self.resolve_ty_shallow(from_ty); |
23 | let to_ty = self.resolve_ty_shallow(to_ty); | 23 | let to_ty = self.resolve_ty_shallow(to_ty); |
24 | // TODO handle expectations properly | ||
25 | if to_ty.is_unknown() { | ||
26 | return true; | ||
27 | } | ||
28 | match self.coerce_inner(from_ty, &to_ty) { | 24 | match self.coerce_inner(from_ty, &to_ty) { |
29 | Ok(result) => { | 25 | Ok(result) => { |
30 | self.table.register_infer_ok(result); | 26 | self.table.register_infer_ok(result); |