(self, op: IntOp)
| 430 | pass |
| 431 | |
| 432 | def visit_int_op(self, op: IntOp) -> None: |
| 433 | self.expect_primitive_type(op, op.lhs) |
| 434 | self.expect_primitive_type(op, op.rhs) |
| 435 | self.expect_non_float(op, op.lhs) |
| 436 | self.expect_non_float(op, op.rhs) |
| 437 | left = op.lhs.type |
| 438 | right = op.rhs.type |
| 439 | op_str = op.op_str[op.op] |
| 440 | if ( |
| 441 | isinstance(left, RPrimitive) |
| 442 | and isinstance(right, RPrimitive) |
| 443 | and left.is_signed != right.is_signed |
| 444 | and ( |
| 445 | op_str in ("+", "-", "*", "/", "%") |
| 446 | or (op_str not in ("<<", ">>") and left.size != right.size) |
| 447 | ) |
| 448 | and not is_pointer_arithmetic(op) |
| 449 | ): |
| 450 | self.fail(op, f"Operand types have incompatible signs: {left}, {right}") |
| 451 | |
| 452 | def visit_comparison_op(self, op: ComparisonOp) -> None: |
| 453 | self.check_compatibility(op, op.lhs.type, op.rhs.type) |
nothing calls this directly
no test coverage detected