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

(SSA Refactor) Assert in acir gen after flattening pass merges two values #1768

Closed
jfecher opened this issue Jun 20, 2023 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@jfecher
Copy link
Contributor

jfecher commented Jun 20, 2023

Aim

Compiling code with if's with conditions that are witnesses:

fn main(a: bool, b: u32, c: u32) -> u32 {
    if a { b } else { c }
}

Expected Behavior

Expected the code to compile

Bug

The compiler panics with

Message:  assertion failed: `(left == right)`
  left: `Unsigned { bit_size: 1 }`,
 right: `Unsigned { bit_size: 32 }`: lhs and rhs types in Binary { lhs: Id(7176), rhs: Id(7183), operator: Mul } are not the same
Location: crates/noirc_evaluator/src/ssa_refactor/acir_gen/mod.rs:484

since the desugaring into a*b + (!a)*c, a and b are different types in the multiplication. a is a bool and b is a u32.

This affects: 9_conditional, 8_arrays, and regression after #1767 is merged.

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

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

No branches or pull requests

1 participant