ruff/crates/ty_python_semantic
Eric Mark Martin c9dfb51f49
[ty] Fix match pattern value narrowing to use equality semantics (#20882)
## Summary

Resolves https://github.com/astral-sh/ty/issues/1349.

Fix match statement value patterns to use equality comparison semantics
instead of incorrectly narrowing to literal types directly. Value
patterns use equality for matching, and equality can be overridden, so
we can't always narrow to the matched literal.

## Test Plan

Updated match.md with corrected expected types and an additional example
with explanation

---------

Co-authored-by: David Peter <mail@david-peter.de>
2025-10-16 07:50:32 +00:00
..
resources [ty] Fix match pattern value narrowing to use equality semantics (#20882) 2025-10-16 07:50:32 +00:00
src [ty] Fix match pattern value narrowing to use equality semantics (#20882) 2025-10-16 07:50:32 +00:00
tests [ty] Track open files in the server (#19264) 2025-07-18 19:33:35 +05:30
build.rs Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
Cargo.toml [ty] Avoid overcounting shared memory usage (#19773) 2025-08-06 15:32:02 -04:00
mdtest.py [ty] Faster iteration on mdtests (#20465) 2025-09-18 10:48:52 +00:00
mdtest.py.lock Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00