Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an explicit return type field into ABI #678

Closed
kevaundray opened this issue Jan 21, 2023 · 0 comments · Fixed by #865
Closed

Add an explicit return type field into ABI #678

kevaundray opened this issue Jan 21, 2023 · 0 comments · Fixed by #865
Labels
enhancement New feature or request

Comments

@kevaundray
Copy link
Contributor

Problem

Currently the ABI does not have a concept of a return parameter, only parameters. So to emulate a return parameter, a constant MAIN_RETURN_NAME is used in the parameter list.

Solution

Ad return_type to ABI. This means that we can remove the MAIN_RETURN_NAME constant from the compiler and it is solely a value that lives in noirc_abi. When the Verifier.toml file is parsed, this is the only time that one needs to check for MAIN_RETURN_NAME so that it can be placed into the return_parameter field.

Note that the field to add is return_type and not return_parameter :

When converting noir return parameters into ABI parameters; we are currently doing this for only the main function. This is more abundant by the fact that we name that return parameter MAIN_RETURN_NAME. We have already noted that the main return type needs to be public, so the visibility field here is not useful. (There is an argument to be made that to make the function more generic, we should return the visibility) For this argument, we can simply return the type and visibility.

Alternatives considered

Additional context

@kevaundray kevaundray added the enhancement New feature or request label Jan 21, 2023
@TomAFrench TomAFrench changed the title Add an explicit retun field into ABI Add an explicit return type field into ABI Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant