File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -417,12 +417,20 @@ def visit_int_op(self, op: IntOp) -> None:
417417 or (op_str not in ("<<" , ">>" ) and left .size != right .size )
418418 )
419419 ):
420- self .fail (op , f"Operand types have incompatible signs: { op . lhs . type } , { op . rhs . type } " )
420+ self .fail (op , f"Operand types have incompatible signs: { left } , { right } " )
421421
422422 def visit_comparison_op (self , op : ComparisonOp ) -> None :
423423 self .check_compatibility (op , op .lhs .type , op .rhs .type )
424424 self .expect_non_float (op , op .lhs )
425425 self .expect_non_float (op , op .rhs )
426+ left = op .lhs .type
427+ right = op .rhs .type
428+ if (
429+ isinstance (left , RPrimitive )
430+ and isinstance (right , RPrimitive )
431+ and left .is_signed != right .is_signed
432+ ):
433+ self .fail (op , f"Operand types have incompatible signs: { left } , { right } " )
426434
427435 def visit_float_op (self , op : FloatOp ) -> None :
428436 self .expect_float (op , op .lhs )
You can’t perform that action at this time.
0 commit comments