Add support for yiled keyword

This commit is contained in:
Daiki Ihara 2021-01-14 00:01:50 +09:00
parent d9b1fa6da3
commit 85cd3524e2
8 changed files with 95 additions and 27 deletions

View file

@ -367,6 +367,13 @@ impl<'a> InferenceContext<'a> {
}
Ty::simple(TypeCtor::Never)
}
Expr::Yield { expr } => {
// FIXME: track yield type for coercion
if let Some(expr) = expr {
self.infer_expr(*expr, &Expectation::none());
}
Ty::simple(TypeCtor::Never)
}
Expr::RecordLit { path, fields, spread } => {
let (ty, def_id) = self.resolve_variant(path.as_ref());
if let Some(variant) = def_id {