ruff
b0c6217e - [ty] Fix broken property tests for disjointness of intersections (#20775)

Commit
63 days ago
[ty] Fix broken property tests for disjointness of intersections (#20775) ## Summary Two stable property tests are currently failing on `main`, following https://github.com/astral-sh/ruff/commit/f054b8a55e759f3afa9d9cf0acf819185228a739 (of course, I only thought to run the property tests again around 30 minutes _after_ landing that PR...). The issue is quite subtle, and took me an annoying amount of time to pin down: we're matching over `(self, other)` in `Type::is_disjoint_from_impl`, but `other` here is shadowed by the binding in the `match` branch, which means that the wrong key is inserted into the cache of the `IsDisjointFrom` cycle detector: https://github.com/astral-sh/ruff/blob/f054b8a55e759f3afa9d9cf0acf819185228a739/crates/ty_python_semantic/src/types.rs#L2408-L2435 This PR fixes that issue, and also adds a few `Debug` implementations to our cycle detectors, so that issues like this are easier to debug in the future. I'm adding the `internal` label, as this fixes a bug that hasn't yet appeared in any released version of ty, so it doesn't deserve its own changelog entry. ## Test Plan `QUICKCHECK_TESTS=1000000 cargo test --release -p ty_python_semantic -- --ignored types::property_tests::stable` now once again passes on `main` I considered adding new mdtests as well, but the examples that the property tests were throwing at me all seemed _quite_ obscure and somewhat unlikely to occur in the real world. I don't think it's worth it.
Author
Parents
Loading