ruff
48e65418 - [red-knot] Negation reverses subtyping order (#15503)

Commit
246 days ago
[red-knot] Negation reverses subtyping order (#15503) ## Summary If `S <: T`, then `~T <: ~S`. This test currently fails with example like: ``` S = tuple[()] T = ~Literal[True] & ~Literal[False] ``` `T` is equivalent to `~(Literal[True] | Literal[False])` and therefore equivalent to `~bool`, but the minimal example for a failure is what is stated above. We correctly recognize that `S <: T`, but fail to see that `~T <: ~S`, i.e. `bool <: ~tuple[()]`. This is why the tests goes into the "flaky" section as well. ## Test Plan ``` export QUICKCHECK_TESTS=100000 while cargo test --release -p red_knot_python_semantic -- --ignored types::property_tests::flaky::negation_reverses_subtype_order; do :; done ```
Author
Parents
Loading