leo
leo copied to clipboard
[Feature] Eq for circuits
🚀 Feature
right now attempting to use ==
on circuits causes the following error
circuit One {
x: u8,
}
function main () {
let x = One {x: 5};
let y = One {x: 3};
if x == y {
console.log("test");
}
}
Error: --> "d:\\Work\\leo_playground\\src/main.leo": 8:8
|
8 | if x == y {
| ^^^^^^
|
= no implementation for `One {x: 5} == One {x: 3}`
the current workaround to this is to decompose a circuit into its individual fields and compare them separately, like so:
circuit One {
x: u8,
}
function main () {
let x = One {x: 5};
let y = One {x: 3};
if x.x == y.x {
console.log("test");
}
}
while this works, its not as straightforward to the user as implementing Eq on circuits would be
Possibly closed by #1375 The above example builds on the IR branch
Deleting "Icebox" board so this issue will be moved to "New Issues"
Hey @collinc97, is this issue still open? I know some devs who'd be interested in working on this. If you have a budget for it, I can put this issue up on OpenQ, free of charge.
Thanks!