oops, forgot to return the result
This commit is contained in:
parent
d3e0f12f69
commit
f6ba112d95
|
|
@ -226,6 +226,11 @@ fn build_function(parent: &BuildContext<'_>, code: &ast::Function) -> Function {
|
|||
}
|
||||
}
|
||||
}
|
||||
let ret = Box::new(if let Some(ret) = &code.ret {
|
||||
build_expression(&scope, &ret)
|
||||
} else {
|
||||
Expression::Constant(ast::Constant::Nil)
|
||||
});
|
||||
let scope = scope.scope.into_inner().finish();
|
||||
Function {
|
||||
name: code.name.clone(),
|
||||
|
|
@ -233,7 +238,7 @@ fn build_function(parent: &BuildContext<'_>, code: &ast::Function) -> Function {
|
|||
locals: scope.locals,
|
||||
upvalues: scope.upvalues,
|
||||
body,
|
||||
ret: Box::new(Expression::Constant(ast::Constant::Nil)),
|
||||
ret,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user