ruff/crates/red_knot_python_semantic/resources/mdtest/call
Carl Meyer 27ada26ddb
[red-knot] fix unions of literals, again (#17534)
## Summary

#17451 was incomplete. `AlwaysFalsy` and `AlwaysTruthy` are not the only
two types that are super-types of some literals (of a given kind) and
not others. That set also includes intersections containing
`AlwaysTruthy` or `AlwaysFalsy`, and intersections containing literal
types of the same kind. Cover these cases as well.

Fixes #17478.

## Test Plan

Added mdtests.

`QUICKCHECK_TESTS=1000000 cargo test -p red_knot_python_semantic --
--ignored types::property_tests::stable` failed on both
`all_fully_static_type_pairs_are_subtypes_of_their_union` and
`all_type_pairs_are_assignable_to_their_union` prior to this PR, passes
after it.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-04-22 16:12:52 +00:00
..
annotation.md red_knot_python_semantic: replace one use of "old" secondary diagnostic messages 2025-04-10 13:21:00 -04:00
builtins.md [red-knot] Three-argument type-calls take 'str' as the first argument (#17168) 2025-04-03 15:45:08 +02:00
callable_instance.md red_knot_python_semantic: replace one use of "old" secondary diagnostic messages 2025-04-10 13:21:00 -04:00
constructor.md red_knot_python_semantic: replace one use of "old" secondary diagnostic messages 2025-04-10 13:21:00 -04:00
dunder.md Fix member lookup for unions & intersections ignoring policy (#17066) 2025-03-31 09:40:47 +02:00
function.md [red-knot] Detect version-related syntax errors (#16379) 2025-04-17 14:00:30 -04:00
getattr_static.md [red-knot] improve function/bound method type display (#17294) 2025-04-14 15:56:18 -07:00
invalid_syntax.md red_knot_python_semantic: replace one use of "old" secondary diagnostic messages 2025-04-10 13:21:00 -04:00
methods.md [red-knot] Handle explicit class specialization in type expressions (#17434) 2025-04-18 11:49:22 -04:00
never.md [red-knot] Never is callable and iterable. Arbitrary attributes can be accessed. (#16533) 2025-03-06 15:59:19 +00:00
str_startswith.md [red-knot] Specialize str.startswith for string literals (#17351) 2025-04-11 16:26:45 +02:00
subclass_of.md red_knot_python_semantic: replace one use of "old" secondary diagnostic messages 2025-04-10 13:21:00 -04:00
union.md [red-knot] fix unions of literals, again (#17534) 2025-04-22 16:12:52 +00:00