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

comptime #1

Closed
gnart33 opened this issue Jun 17, 2023 · 4 comments
Closed

comptime #1

gnart33 opened this issue Jun 17, 2023 · 4 comments

Comments

@gnart33
Copy link

gnart33 commented Jun 17, 2023

In comptime example, you said that

// cannot be mutable tho, so this would fail???
let mut bad_var: comptime Field = 3;

But looks like mutable is ok, the error is unused variable bad_var. using it e.g. assert(bad_var == 3); will work

So comptime Field can be mutable apparently?

@sambarnes
Copy link
Owner

hmm i thought it errored when i was writing this 🤔 but yeah retried it now and its not erroring

the official docs say that it should fail too:
https://noir-lang.org/language_concepts/mutability/#comptime-values


might be better to open an issue in the main noir repo if you're up for it @trangnv!

@sambarnes
Copy link
Owner

i've updated the example such that the unused variable warning won't show -- instead, the failure should show once the bug is patched in noir itself

225c7b3

@gnart33
Copy link
Author

gnart33 commented Jun 18, 2023

Sure will take a look and file one on noir repo if necessary

@sambarnes
Copy link
Owner

ah rad -- closing :)

image

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

No branches or pull requests

2 participants