ruff/crates/red_knot_python_semantic
David Peter fa7626160b
[red-knot] handle unions on the LHS of is_subtype_of (#13857)
## Summary

Just a drive-by change that occurred to me while I was looking at
`Type::is_subtype_of`: the existing pattern for unions on the *right
hand side*:
```rs
            (ty, Type::Union(union)) => union
                .elements(db)
                .iter()
                .any(|&elem_ty| ty.is_subtype_of(db, elem_ty)),
```
is not (generally) correct if the *left hand side* is a union.

## Test Plan

Added new test cases for `is_subtype_of` and `!is_subtype_of`
2024-10-21 20:12:03 +02:00
..
resources [red-knot] Implement more types in binary and unary expressions (#13803) 2024-10-20 01:57:21 +00:00
src [red-knot] handle unions on the LHS of is_subtype_of (#13857) 2024-10-21 20:12:03 +02:00
tests [red-knot] Cleanup generated names of mdtest tests (#13831) 2024-10-20 15:11:53 +00:00
build.rs Modernize build scripts (#13837) 2024-10-20 22:35:35 +01:00
Cargo.toml [red-knot] Cleanup generated names of mdtest tests (#13831) 2024-10-20 15:11:53 +00:00