Fix bug in match arm type unification

This commit is contained in:
Marcus Klaas de Vries 2019-01-17 13:47:26 +01:00 committed by Aleksey Kladov
parent 44e9a9605b
commit 5027c5d4ee

View File

@ -1143,7 +1143,7 @@ fn infer_expr(&mut self, expr: ExprId, expected: &Expectation) -> Ty {
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);