-
Notifications
You must be signed in to change notification settings - Fork 169
QIR generation fails when code includes comparison of tuples or arrays #2992
Copy link
Copy link
Open
Labels
Description
RCA does not block programs with comparisons of Result tuples or Result arrays, because Results are considered supported dynamic types. However, comparison across aggregates is not supported in partial eval, so it hits an unexpected failure at QIR generation time.
Here's some example code:
operation Main() : Bool {
use (q0, q1) = (Qubit(), Qubit());
let (r0, r1) = (M(q0), M(q1));
// This version succeeds because it does individual comparisons
// r0 == Zero and r1 == Zero
// This version fails because it compares across arrays.
// [r0, r1] == [Zero, Zero]
// This version also fails because it compares across tuples.
(r0, r1) == (Zero, Zero)
}We need to decide to either support destructing aggregate comparison into individual comparisons in RCA or block comparison of aggregates in RCA so the user gets a design time error.
Reactions are currently unavailable