From 8bf2d1a2666db2fa02e15751efbf31d54a992392 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Mon, 16 Dec 2024 14:04:30 +0100 Subject: [PATCH] flag the function as inline after checking style Signed-off-by: Jakub Doka --- lang/src/son.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/src/son.rs b/lang/src/son.rs index 8a87b33..764d874 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -4582,8 +4582,6 @@ impl<'a> Codegen<'a> { let ast = &self.files[file]; let &Expr::Closure { args: cargs, body, .. } = expr.get(ast) else { unreachable!() }; - inline |= sig.ret == ty::Id::TYPE; - let arg_count = args.len() + caller.is_some() as usize; if arg_count != cargs.len() { self.error( @@ -4604,6 +4602,8 @@ impl<'a> Codegen<'a> { ); } + inline |= sig.ret == ty::Id::TYPE; + let (mut tys, mut args, mut cargs) = (sig.args.args(), args.iter(), cargs.iter()); if is_inline || inline { let var_base = self.ci.scope.vars.len();