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

Variable was defined twice when instantiating an array of structs in one expression #1925

Closed
sirasistant opened this issue Jul 13, 2023 · 3 comments
Assignees
Labels
bug Something isn't working refactor ssa

Comments

@sirasistant
Copy link
Contributor

sirasistant commented Jul 13, 2023

Aim

The following should compile

struct Point {
    x: Field,
    y: Field,
}

fn main()  {
    let arr = [Point { x: 0, y: 3 }];
}

Expected Behavior

No errors!

Bug

The application panicked (crashed).
Message:  Variable LocalId(0) was defined twice in ssa-gen pass
Location: crates/noirc_evaluator/src/ssa_refactor/ssa_gen/context.rs:400

To Reproduce

Installation Method

None

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@sirasistant sirasistant added the bug Something isn't working label Jul 13, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jul 13, 2023
@jfecher
Copy link
Contributor

jfecher commented Jul 13, 2023

Interesting, I've never seen this error before. I assume it is an issue with the array of structs to struct of arrays conversion that we want to disable soon anyway. I'll look into it to verify if that is the case and disable it sooner rather than later.

@vezenovm
Copy link
Contributor

This error doesn't happen in #1917 where I conditionally remove aos_to_soa checks for the experimental ssa.

@vezenovm
Copy link
Contributor

Issue resolved following #1917 being merged into master

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 24, 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 refactor ssa
Projects
Archived in project
Development

No branches or pull requests

4 participants