Implement const block inference

This commit is contained in:
Lukas Wirth 2020-12-23 12:24:24 +01:00
parent 0a780c0ab3
commit a142beaf01
5 changed files with 25 additions and 6 deletions

View file

@ -155,7 +155,7 @@ impl<'a> InferenceContext<'a> {
}
None => self.infer_block(statements, *tail, expected),
},
Expr::Unsafe { body } => self.infer_expr(*body, expected),
Expr::Unsafe { body } | Expr::Const { body } => self.infer_expr(*body, expected),
Expr::TryBlock { body } => {
let _inner = self.infer_expr(*body, expected);
// FIXME should be std::result::Result<{inner}, _>