Skip to content

Reconstruct nested values from function#542

Merged
guipublic merged 7 commits intomasterfrom
gd/nested_return
Dec 1, 2022
Merged

Reconstruct nested values from function#542
guipublic merged 7 commits intomasterfrom
gd/nested_return

Conversation

@guipublic
Copy link
Copy Markdown
Contributor

@guipublic guipublic commented Nov 30, 2022

Related issue(s)

Resolves #492

Description

Summary of changes

Flatten data returned from a function is reconstructed into a value using the function return type.
This PR deprecate #537 I believe.

Test additions / changes

Regression test case added in 'struct' test case

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

@guipublic
Copy link
Copy Markdown
Contributor Author

guipublic commented Nov 30, 2022

N.B. I could not validate that this circuit is passing: https://github.com/vezenovm/aztec-circuits-noir/pull/5/files , as explained in issue #529,
because it uses dependencies (notes..) that are not provided.
@vezenovm, could you check that this PR works for this circuit?

@guipublic guipublic requested a review from vezenovm November 30, 2022 17:54
Copy link
Copy Markdown
Contributor

@vezenovm vezenovm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing up my PR @guipublic. This is a much cleaner way of handling it, I was looking only at create_function for generating the SSA func. I should have looked at the Expression::Call branch of codegen_expression to see what happens after create_function is called.

Copy link
Copy Markdown
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@guipublic guipublic merged commit 116e167 into master Dec 1, 2022
@guipublic guipublic deleted the gd/nested_return branch December 1, 2022 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot return tuple with struct inside

3 participants