ruff/crates/ty_python_semantic/resources/mdtest/narrow
Shunsuke Shibayama 351121c5c5
[ty] fix incorrect lazy scope narrowing (#19744)
## Summary

This is a follow-up to #19321.

Narrowing constraints introduced in a class scope were not applied even
when they can be applied in lazy nested scopes. This PR fixes so that
they are now applied.
Conversely, there were cases where narrowing constraints were being
applied in places where they should not, so it is also fixed.

## Test Plan

Some TODOs in `narrow/conditionals/nested.md` are now work correctly.
2025-08-04 20:32:08 -07:00
..
conditionals [ty] fix incorrect lazy scope narrowing (#19744) 2025-08-04 20:32:08 -07:00
assert.md
assignment.md [ty] Support __setitem__ and improve __getitem__ related diagnostics (#19578) 2025-08-01 09:23:27 +02:00
bool-call.md
boolean.md
complex_target.md [ty] Track different uses of legacy typevars, including context when rendering typevars (#19604) 2025-08-01 12:20:32 -04:00
hasattr.md [ty] Attribute access on intersections with negative parts (#19524) 2025-07-25 14:56:14 +02:00
isinstance.md [ty] Support narrowing on isinstance()/issubclass() if the second argument is a dynamic, intersection, union or typevar type (#18900) 2025-06-24 10:55:26 +00:00
issubclass.md [ty] Support narrowing on isinstance()/issubclass() if the second argument is a dynamic, intersection, union or typevar type (#18900) 2025-06-24 10:55:26 +00:00
match.md [ty] Improve disjointness inference for NominalInstanceTypes and SubclassOfTypes (#18864) 2025-06-24 20:27:37 +00:00
post_if_statement.md
truthiness.md [ty] Reachability constraints (#18621) 2025-06-17 09:24:28 +02:00
type.md [ty] Surface matched overload diagnostic directly (#18452) 2025-06-20 08:36:49 +05:30
type_guards.md [ty] Splat variadic arguments into parameter list (#18996) 2025-07-22 14:33:08 -04:00
while.md [ty] Eagerly simplify 'True' and 'False' constraints (#18998) 2025-06-30 13:11:52 +02:00