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

Ban nested slices #4017

Closed
Tracked by #3363
vezenovm opened this issue Jan 11, 2024 · 0 comments · Fixed by #4018
Closed
Tracked by #3363

Ban nested slices #4017

vezenovm opened this issue Jan 11, 2024 · 0 comments · Fixed by #4018
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vezenovm
Copy link
Contributor

Problem

Following #3979 and an internal discussion we have decided to shelve nested slices temporarily as the code has gotten very complex for a single feature. There are efficiencies issues with the current approach as well where it may not even be worth it for a developer to use nested slices.

Happy Case

Block any usage of nested slices, either in struct field types, declared types in let statements, or declared literals.

Alternatives Considered

We will consider removing the check against nested slices once a new slice planning session has been conducted.

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@vezenovm vezenovm added the enhancement New feature or request label Jan 11, 2024
@vezenovm vezenovm self-assigned this Jan 11, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 11, 2024
@Savio-Sou Savio-Sou added this to the 0.23.0 milestone Jan 12, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 16, 2024
# Description

## Problem\*

Resolves #4017 

## Summary\*

After this PR #3979 and an
internal discussion we have decided to temporarily block nested slices.

This PR adds a check in the frontend and in the SSA against nested
slices. The check in the frontend makes sure any struct fields with a
nested slice (but without generics) are not blocked as well as any type
declarations with nested slices. In order to account for generics in
structs we also have a checked array codegen that makes sure we do not
have a nested slice.

## Additional Context

The actual nested slice code in the ACIR gen is somewhat intertwined so
I felt it would be best for a separate PR which will be a followup to
this one.

## Documentation\*

Check one:
- [] No documentation needed.
- [X] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jan 16, 2024
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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants