diff --git a/lang/src/son.rs b/lang/src/son.rs index 59ba3ab3..9b4ae377 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -3850,11 +3850,11 @@ impl<'a> Codegen<'a> { let (v, ctrl, scope) = mem::replace(&mut self.ci.inline_ret, prev_inline_ret)?; if is_inline - && (ctrl.get() != prev_ctrl - && (!matches!(self.ci.nodes[ctrl.get()].kind, Kind::Call { - func: ty::Func::ECA, - .. - }) || self.ci.nodes[ctrl.get()].inputs[0] != prev_ctrl)) + && ctrl.get() != prev_ctrl + && (!matches!(self.ci.nodes[ctrl.get()].kind, Kind::Call { + func: ty::Func::ECA, + .. + }) || self.ci.nodes[ctrl.get()].inputs[0] != prev_ctrl) { self.report(body.pos(), "function is makred inline but it contains controlflow"); } @@ -4075,6 +4075,7 @@ impl<'a> Codegen<'a> { base: Some(*func), sig: Some(Sig { args, ret }), expr: fuc.expr, + is_inline: fuc.is_inline, ..Default::default() }) .into()