-
Notifications
You must be signed in to change notification settings - Fork 328
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Aim
The noir_codegen tool generates syntactically incorrect TypeScript code for Noir functions that don't return a value.
Expected Behavior
Functions with no return value should generate:
- Return type:
Promise<void>
- No return statement or just
return;
Bug
Functions with no return value incorrectly generate:
- Return type:
Promise<null>
- Return statement:
return returnValue as null;
To Reproduce
- Create a Noir function with no return value:
#[export]
pub fn test(x: u64) {
assert(x > 0);
}
- Run noir_codegen
- Observe the generated TypeScript has
Promise<null>
andreturn returnValue as null;
Workaround
Yes
Workaround Description
I am running a shell script in my workflow to remove this line return returnValue as null;
Additional Context
No response
Project Impact
Nice-to-have
Blocker Context
This prevents the generated TypeScript from compiling, breaking the developer workflow.
Nargo Version
1.0.0-beta.12
NoirJS Version
1.0.0-beta.11
Proving Backend Tooling & Version
bb 0.87.0
Would you like to submit a PR for this Issue?
None
Support Needs
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
📋 Backlog