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

Constructors do not check the required number of fields #1028

Closed
1 task
jfecher opened this issue Mar 23, 2023 · 0 comments · Fixed by #1036 or #1005
Closed
1 task

Constructors do not check the required number of fields #1028

jfecher opened this issue Mar 23, 2023 · 0 comments · Fixed by #1036 or #1005
Assignees
Labels
bug Something isn't working

Comments

@jfecher
Copy link
Contributor

jfecher commented Mar 23, 2023

Aim

Trying to construct a struct type by providing it the incorrect number of fields (on accident):

struct TwoFields {
    first: Field,
    second: Field,
}

fn main() {
    let _foo = TwoFields { first: 0 };
}

Expected behavior

The compiler should issue an error explaining that the second field is missing from the constructor.

Bug

Instead, the compiler continues until type checking fails an assert check for the number of fields.

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.
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
1 participant