Commit 11a9e7e
authored
[ty] use type context more aggressively to infer values when constructing a
## Summary
Based on @ibraheemdev's comment on #20792:
> I think we can also update our bidirectional inference code, [which
makes the same
assumption](https://github.com/astral-sh/ruff/blob/main/crates/ty_python_semantic/src/types/infer/builder.rs?rgh-link-date=2025-10-09T21%3A30%3A31Z#L5860).
This PR also adds more test cases for how `TypedDict` annotations affect
generic call inference.
## Test Plan
New tests in `typed_dict.md`TypedDict (#20806)1 parent bbd3856 commit 11a9e7e
File tree
2 files changed
+65
-4
lines changed- crates/ty_python_semantic
- resources/mdtest
- src/types/infer
2 files changed
+65
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
108 | 146 | | |
109 | 147 | | |
110 | 148 | | |
| |||
796 | 834 | | |
797 | 835 | | |
798 | 836 | | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
799 | 849 | | |
800 | 850 | | |
801 | 851 | | |
| |||
817 | 867 | | |
818 | 868 | | |
819 | 869 | | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
820 | 882 | | |
821 | 883 | | |
822 | 884 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5858 | 5858 | | |
5859 | 5859 | | |
5860 | 5860 | | |
5861 | | - | |
| 5861 | + | |
5862 | 5862 | | |
5863 | | - | |
5864 | | - | |
5865 | | - | |
| 5863 | + | |
| 5864 | + | |
5866 | 5865 | | |
5867 | 5866 | | |
5868 | 5867 | | |
| |||
0 commit comments