mirror of https://github.com/astral-sh/ruff
## Summary
Properly handle binary operator inference for union types.
This fixes a bug I noticed while looking at ecosystem results. The MRE
version of it is this:
```py
def sub(x: float, y: float):
# Red Knot: Operator `-` is unsupported between objects of type `int | float` and `int | float`
return x - y
```
## Test Plan
- New Markdown tests.
- Expected diff in the ecosystem checks
|
||
|---|---|---|
| .. | ||
| booleans.md | ||
| classes.md | ||
| custom.md | ||
| instances.md | ||
| integers.md | ||
| unions.md | ||