From 85cd3524e28443836658615fe40599bf10a96943 Mon Sep 17 00:00:00 2001 From: Daiki Ihara Date: Thu, 14 Jan 2021 00:01:50 +0900 Subject: Add support for yiled keyword --- crates/hir_ty/src/infer/expr.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/hir_ty') diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index f2fc69b2f..9bf3b51b0 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -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 { -- cgit v1.2.3