ruff
de8f4e62 - [red-knot] more type-narrowing in match statements (#17302)

Commit
154 days ago
[red-knot] more type-narrowing in match statements (#17302) ## Summary Add more narrowing analysis for match statements: * add narrowing constraints from guard expressions * add negated constraints from previous predicates and guards to subsequent cases This PR doesn't address that guards can mutate your subject, and so theoretically invalidate some of these narrowing constraints that you've previously accumulated. Some prior art on this issue [here][mutable guards]. [mutable guards]: https://www.irif.fr/~scherer/research/mutable-patterns/mutable-patterns-mlworkshop2024-abstract.pdf ## Test Plan Add some new tests, and update some existing ones --------- Co-authored-by: Carl Meyer <carl@astral.sh>
Parents
Loading