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 assert_comptime builtin to panic if a value is not compile-time known #2223

Closed
jfecher opened this issue Aug 8, 2023 · 0 comments · Fixed by #2242
Closed

Add assert_comptime builtin to panic if a value is not compile-time known #2223

jfecher opened this issue Aug 8, 2023 · 0 comments · Fixed by #2242
Assignees
Labels
compiler frontend `noirc_frontend` crate enhancement New feature or request ssa

Comments

@jfecher
Copy link
Contributor

jfecher commented Aug 8, 2023

Problem

After #2178 is merged it will be more difficult for users to track whether a value can be used as a for loop bound or if it will be efficient to use as an array index or not.

Happy Case

We should add an assert_comptime function for debugging which will panic before the loop unrolling step in SSA if a value is not known by that time. This time was chosen because the loop unrolling step is the only step (currently) that will error if a value (loop bounds) are not known at compile-time.

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@jfecher jfecher added the enhancement New feature or request label Aug 8, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Aug 8, 2023
@jfecher jfecher self-assigned this Aug 8, 2023
@jfecher jfecher added E-LOW ssa compiler frontend `noirc_frontend` crate labels Aug 8, 2023
@jfecher jfecher mentioned this issue Aug 9, 2023
5 tasks
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler frontend `noirc_frontend` crate enhancement New feature or request ssa
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant