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

Cannot use globals in struct generics #1042

Closed
1 task
jfecher opened this issue Mar 27, 2023 · 0 comments · Fixed by #1043
Closed
1 task

Cannot use globals in struct generics #1042

jfecher opened this issue Mar 27, 2023 · 0 comments · Fixed by #1043
Labels
bug Something isn't working

Comments

@jfecher
Copy link
Contributor

jfecher commented Mar 27, 2023

Aim

Trying to use a global constant as a numeric generic for a struct (this works with arrays but not other types):

global MY_GLOBAL = 2;

struct Foo {
    myvec: BoundedVec<Field, MY_GLOBAL>,
}

Expected behavior

The program to compile successfully

Bug

The compiler issues an error message:

error: expected type got global
   ┌─ /.../example.nr:4:30
   │
4  │     myvec: BoundedVec<Field, MY_GLOBAL>,
   │                              ---------

To reproduce

Installation method

None

Nargo version

No response

@noir-lang/noir_wasm version

No response

@noir-lang/barretenberg version

No response

@noir-lang/aztec_backend version

No response

Additional context

No response

Submission Checklist

  • Once I hit submit, I will assign this issue to the Project Board with the appropriate tags.
@jfecher jfecher added the bug Something isn't working label Mar 27, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Mar 27, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant