Commit 6740325
authored
[ty] Restrict uncached raw signature access (#25866)
## Summary
This follows up on [the post-merge
review](#25761 (comment))
of #25761.
`FunctionLiteral::last_definition_raw_signature` bypasses the tracked
`FunctionType` query and therefore must only be called for a function
defined in the same module. After #25761, the method was visible
throughout the `types` module, making it easy for a future caller to
accidentally introduce a cross-module AST dependency and
over-invalidation.
This restores the method's privacy and routes the existing same-module
callers through a dedicated `same_module_uncached_raw_signature`
wrapper. The wrapper's name and documentation make the restriction
explicit, while cross-module callers continue to use the tracked query.1 parent 970b1bf commit 6740325
3 files changed
Lines changed: 51 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
874 | | - | |
| 874 | + | |
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
956 | 973 | | |
957 | 974 | | |
958 | 975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
5109 | 5110 | | |
5110 | 5111 | | |
5111 | 5112 | | |
5112 | | - | |
5113 | | - | |
5114 | | - | |
5115 | | - | |
5116 | | - | |
5117 | | - | |
5118 | | - | |
| 5113 | + | |
| 5114 | + | |
| 5115 | + | |
| 5116 | + | |
| 5117 | + | |
| 5118 | + | |
5119 | 5119 | | |
5120 | 5120 | | |
5121 | 5121 | | |
| |||
8748 | 8748 | | |
8749 | 8749 | | |
8750 | 8750 | | |
8751 | | - | |
8752 | | - | |
8753 | | - | |
8754 | | - | |
| 8751 | + | |
| 8752 | + | |
| 8753 | + | |
| 8754 | + | |
| 8755 | + | |
| 8756 | + | |
8755 | 8757 | | |
8756 | 8758 | | |
8757 | 8759 | | |
| |||
8797 | 8799 | | |
8798 | 8800 | | |
8799 | 8801 | | |
8800 | | - | |
8801 | | - | |
8802 | | - | |
8803 | | - | |
| 8802 | + | |
| 8803 | + | |
| 8804 | + | |
| 8805 | + | |
| 8806 | + | |
| 8807 | + | |
8804 | 8808 | | |
8805 | 8809 | | |
8806 | 8810 | | |
| |||
Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 84 | + | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
| |||
0 commit comments