ruff/crates/ty_python_semantic/resources/mdtest/narrow
Suneet Tipirneni ef8281b695
[ty] add support for mapped union and intersection subscript loads (#18846)
## Summary

Note this modifies the diagnostics a bit. Previously performing
subscript access on something like `NotSubscriptable1 |
NotSubscriptable2` would report the full type as not being
subscriptable:

```
[non-subscriptable] "Cannot subscript object of type `NotSubscriptable1 | NotSubscriptable2` with no `__getitem__` method"
```

Now each erroneous constituent has a separate error:

```
[non-subscriptable] "Cannot subscript object of type `NotSubscriptable2` with no `__getitem__` method"
[non-subscriptable] "Cannot subscript object of type `NotSubscriptable1` with no `__getitem__` method"
```

Closes https://github.com/astral-sh/ty/issues/625

## Test Plan

 mdtest

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
2025-06-23 16:38:01 +00:00
..
conditionals [ty] basic narrowing on attribute and subscript expressions (#17643) 2025-06-17 11:07:46 +02:00
assert.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
assignment.md [ty] basic narrowing on attribute and subscript expressions (#17643) 2025-06-17 11:07:46 +02:00
bool-call.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
boolean.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
complex_target.md [ty] Homogeneous and mixed tuples (#18600) 2025-06-20 18:23:54 -04:00
hasattr.md [ty] Only consider a type T a subtype of a protocol P if all of P's members are fully bound on T (#18466) 2025-06-04 19:39:14 +00:00
isinstance.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
issubclass.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
match.md [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
post_if_statement.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
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] add support for mapped union and intersection subscript loads (#18846) 2025-06-23 16:38:01 +00:00
while.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00