File tree 1 file changed +9
-4
lines changed
crates/noirc_evaluator/src/ssa_refactor/ir
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -549,15 +549,21 @@ impl Binary {
549
549
dfg : & mut DataFlowGraph ,
550
550
lhs : FieldElement ,
551
551
rhs : FieldElement ,
552
- operand_type : Type ,
552
+ mut operand_type : Type ,
553
553
) -> Option < Id < Value > > {
554
554
let value = match self . operator {
555
555
BinaryOp :: Add => lhs + rhs,
556
556
BinaryOp :: Sub => lhs - rhs,
557
557
BinaryOp :: Mul => lhs * rhs,
558
558
BinaryOp :: Div => lhs / rhs,
559
- BinaryOp :: Eq => ( lhs == rhs) . into ( ) ,
560
- BinaryOp :: Lt => ( lhs < rhs) . into ( ) ,
559
+ BinaryOp :: Eq => {
560
+ operand_type = Type :: bool ( ) ;
561
+ ( lhs == rhs) . into ( )
562
+ }
563
+ BinaryOp :: Lt => {
564
+ operand_type = Type :: bool ( ) ;
565
+ ( lhs < rhs) . into ( )
566
+ }
561
567
562
568
// The rest of the operators we must try to convert to u128 first
563
569
BinaryOp :: Mod => self . eval_constant_u128_operations ( lhs, rhs) ?,
@@ -567,7 +573,6 @@ impl Binary {
567
573
BinaryOp :: Shl => self . eval_constant_u128_operations ( lhs, rhs) ?,
568
574
BinaryOp :: Shr => self . eval_constant_u128_operations ( lhs, rhs) ?,
569
575
} ;
570
- // TODO: Keep original type of constant
571
576
Some ( dfg. make_constant ( value, operand_type) )
572
577
}
573
578
You can’t perform that action at this time.
0 commit comments