mirror of https://github.com/astral-sh/ruff
## Summary
This adds type inference for comparison expressions involving
intersection types.
For example:
```py
x = get_random_int()
if x != 42:
reveal_type(x == 42) # revealed: Literal[False]
reveal_type(x == 43) # bool
```
closes #13854
## Test Plan
New Markdown-based tests.
---------
Co-authored-by: Carl Meyer <carl@astral.sh>
|
||
|---|---|---|
| .. | ||
| instances | ||
| byte_literals.md | ||
| identity_tests.md | ||
| integers.md | ||
| intersections.md | ||
| non_boolean_returns.md | ||
| strings.md | ||
| tuples.md | ||
| unions.md | ||
| unsupported.md | ||