Revert "Merge #4233"

This reverts commit a5f2b16366, reversing
changes made to c96b2180c1.
This commit is contained in:
Aleksey Kladov 2020-05-02 01:12:37 +02:00
parent a984587c47
commit fd030f9450
9 changed files with 63 additions and 30 deletions

View file

@ -73,6 +73,11 @@ impl<'a> InferenceContext<'a> {
self.coerce_merge_branch(&then_ty, &else_ty)
}
Expr::Block { statements, tail } => self.infer_block(statements, *tail, expected),
Expr::TryBlock { body } => {
let _inner = self.infer_expr(*body, expected);
// FIXME should be std::result::Result<{inner}, _>
Ty::Unknown
}
Expr::Loop { body } => {
self.infer_expr(*body, &Expectation::has_type(Ty::unit()));
// FIXME handle break with value