We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Now that AOS2SOA has been removed, we need to support nested arrays in brillig to support arrays of structs that hold arrays inside them.
The following should compile:
struct Header { params: [Field; 3], } struct MyNote { plain: Field, array: [Field; 2], header: Header, } unconstrained fn access_nested(notes: [MyNote; 2], x: Field, y: Field) -> Field { notes[x].array[y] + notes[y].array[x] + notes[x].plain + notes[y].header.params[x] } unconstrained fn create_inside_brillig(x: Field, y: Field) { let header = Header { params: [1, 2, 3]}; let note0 = MyNote { array: [1, 2], plain : 3, header }; let note1 = MyNote { array: [4, 5], plain : 6, header }; assert(access_nested([note0, note1], x, y) == (2 + 4 + 3 + 1)); } fn main(x: Field, y: Field) { let header = Header { params: [1, 2, 3]}; let note0 = MyNote { array: [1, 2], plain : 3, header }; let note1 = MyNote { array: [4, 5], plain : 6, header }; create_inside_brillig(x, y); assert(access_nested([note0, note1], x, y) == (2 + 4 + 3 + 1)); }
No response
Yes
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Problem
Now that AOS2SOA has been removed, we need to support nested arrays in brillig to support arrays of structs that hold arrays inside them.
Happy Case
The following should compile:
Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered: