From 80fd0e89b417ee40ea5bc242fffa9028566088f0 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Tue, 12 Nov 2024 17:32:20 +0100 Subject: [PATCH] fixing the inline flag delegation with generic functions --- lang/src/son.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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()