Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove original return from aztec fns (#4804)
The following function: ```rust #[aztec(private)] fn do_work_conditionally() -> u64 { let condition = storage.flag; if condition { 2 } else { 42 } } ``` Will be transformed by the macro, adding a push with the whole if/else expression to `context.return_values`...but without removing the statement in the first place, leading to duplicate code execution. This PR forces the removal of the last function statement in case it is replaced by a push to the context.
- Loading branch information