ruff
4d64cdb8 - [red-knot] `ClassLiteral(<T>)` is not a disjoint type from `Instance(<metaclass of T>)` (#14970)

Commit
360 days ago
[red-knot] `ClassLiteral(<T>)` is not a disjoint type from `Instance(<metaclass of T>)` (#14970) ## Summary A class is an instance of its metaclass, so `ClassLiteral("ABC")` is not disjoint from `Instance("ABCMeta")`. However, we erroneously consider the two types disjoint on the `main` branch. This PR fixes that. This bug was uncovered by adding some more core types to the property tests that provide coverage for classes that have custom metaclasses. The additions to the property tests are included in this PR. ## Test Plan New unit tests and property tests added. Tested with: - `cargo test -p red_knot_python_semantic` - `QUICKCHECK_TESTS=100000 cargo test -p red_knot_python_semantic -- --ignored types::property_tests::stable` The assignability property test fails on this branch, but that's a known issue that exists on `main`, due to https://github.com/astral-sh/ruff/issues/14899.
Author
Parents
Loading