From 5027c5d4ee38e07ee426df433d0c650d55b1be84 Mon Sep 17 00:00:00 2001 From: Marcus Klaas de Vries Date: Thu, 17 Jan 2019 13:47:26 +0100 Subject: Fix bug in match arm type unification --- crates/ra_hir/src/ty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir/src/ty.rs') diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 57fd1ed2a..53b7b5836 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -1143,7 +1143,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { ret_ty } Expr::Match { expr, arms } => { - let mut expected = Expectation::none(); + let mut expected = expected.clone(); let input_ty = self.infer_expr(*expr, &Expectation::none()); let pat_expectation = Expectation::has_type(input_ty); -- cgit v1.2.3