Commit 8eb7394
[ty] Preserve qualifiers when accessing attributes on unions/intersections (astral-sh#20114)
## Summary
Properly preserve type qualifiers when accessing attributes on unions
and intersections. This is a prerequisite for
astral-sh#19579.
Also fix a completely wrong implementation of
`map_with_boundness_and_qualifiers`. It now closely follows
`map_with_boundness` (just above).
## Test Plan
I thought about it, but didn't find any easy way to test this. This only
affected `Type::member`. Things like validation of attribute writes
(where type qualifiers like `ClassVar` and `Final` are important) were
already handling things correctly.1 parent a867935 commit 8eb7394
File tree
2 files changed
+16
-22
lines changed- crates/ty_python_semantic
- resources/mdtest/annotations
- src
2 files changed
+16
-22
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3309 | 3309 | | |
3310 | 3310 | | |
3311 | 3311 | | |
3312 | | - | |
3313 | | - | |
3314 | | - | |
3315 | | - | |
3316 | | - | |
3317 | | - | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
3318 | 3315 | | |
3319 | 3316 | | |
3320 | | - | |
| 3317 | + | |
3321 | 3318 | | |
3322 | | - | |
3323 | | - | |
3324 | | - | |
| 3319 | + | |
3325 | 3320 | | |
3326 | 3321 | | |
3327 | 3322 | | |
| |||
9743 | 9738 | | |
9744 | 9739 | | |
9745 | 9740 | | |
9746 | | - | |
9747 | | - | |
| 9741 | + | |
| 9742 | + | |
9748 | 9743 | | |
9749 | 9744 | | |
9750 | 9745 | | |
9751 | 9746 | | |
9752 | 9747 | | |
9753 | 9748 | | |
9754 | 9749 | | |
9755 | | - | |
9756 | | - | |
9757 | | - | |
| 9750 | + | |
9758 | 9751 | | |
9759 | | - | |
9760 | | - | |
| 9752 | + | |
| 9753 | + | |
| 9754 | + | |
9761 | 9755 | | |
9762 | 9756 | | |
9763 | 9757 | | |
| |||
9766 | 9760 | | |
9767 | 9761 | | |
9768 | 9762 | | |
9769 | | - | |
| 9763 | + | |
9770 | 9764 | | |
9771 | 9765 | | |
9772 | 9766 | | |
9773 | 9767 | | |
9774 | | - | |
9775 | | - | |
9776 | | - | |
| 9768 | + | |
9777 | 9769 | | |
| 9770 | + | |
| 9771 | + | |
9778 | 9772 | | |
9779 | 9773 | | |
9780 | 9774 | | |
| |||
0 commit comments