From f353bd58824a04153587ae6842d4a0dcb05e0437 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Sat, 23 Nov 2024 15:33:28 +0100 Subject: [PATCH] passing down the inference of 'void' to statements --- lang/src/son.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/src/son.rs b/lang/src/son.rs index aef7ce54..a55328d3 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -3625,7 +3625,7 @@ impl<'a> Codegen<'a> { let mut ret = Some(Value::VOID); for stmt in stmts { - ret = ret.and(self.expr(stmt)); + ret = ret.and(self.expr_ctx(stmt, Ctx::default().with_ty(ty::Id::VOID))); if let Some(mut id) = ret { if id.ty != ty::Id::VOID { self.warn(