noir icon indicating copy to clipboard operation
noir copied to clipboard

Add overload for unary `!` operator to call std::ops::Not

Open TomAFrench opened this issue 1 year ago • 2 comments

After https://github.com/noir-lang/noir/pull/4999 we'll have a negation trait, we should allow calling this through an operator overload similar to how we do for arithmetic operations.

TomAFrench avatar May 08 '24 15:05 TomAFrench

@asterite This could also be a good issue to take a look at once you have bandwidth. We've got operator overloads implemented for infix operators but not unary operators.

We'd only need to implement this in the elaborator so changes to this file would be sufficient afaik (you can also see the infix implementation in there).

TomAFrench avatar Jun 25 '24 17:06 TomAFrench

I mention the elaborator as the legacy type-checking pass also implements trait dispatch and without re-implementing it there you may encounter some test case failures on here and we don't need to worry about fixing those.

TomAFrench avatar Jun 25 '24 17:06 TomAFrench