ruff/crates/ty_python_semantic/resources/mdtest/subscript
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
..
bytes.md [ty] Integer indexing into bytes returns int (#18218) 2025-05-20 16:44:12 +02:00
class.md [ty] add support for mapped union and intersection subscript loads (#18846) 2025-06-23 16:38:01 +00:00
instance.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
lists.md [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
stepsize_zero.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
string.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
tuple.md [ty] add support for mapped union and intersection subscript loads (#18846) 2025-06-23 16:38:01 +00:00