Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[red-knot] Move intersection type tests to Markdown (#15396)
## Summary [**Rendered version of the new test suite**](https://github.com/astral-sh/ruff/blob/david/intersection-type-tests/crates/red_knot_python_semantic/resources/mdtest/intersection_types.md) Moves most of our existing intersection-types tests to a dedicated Markdown test suite, extends the test coverage, unifies the notation for these tests, groups tests into a proper structure, and adds some explanations for various simplification strategies. This changeset also: - Adds a new simplification where `~Never` is removed from intersections. - Adds a new simplification where adding `~object` simplifies the whole intersection to `Never` - Avoids unnecessary assignment-checks between inferred and declared type. This was added to this changeset to avoid many false positive errors in this test suite. Resolves the task described in this old comment [here](https://github.com/astral-sh/ruff/pull/13962/files/e01da82a5a0ef6a2af0aa4dc50f898cffadb4a33..e7e432bca2b3f24979da55a9a34ad765aaaae8d1#r1819924085). ## Test Plan Running the new Markdown tests --------- Co-authored-by: Alex Waygood <[email protected]>
- Loading branch information