Commit 9ce3230
authored
[ty] Make implicit submodule imports only occur in global scope (#21370)
This loses any ability to have "per-function" implicit submodule
imports, to avoid the "ok but now we need per-scope imports" and "ok but
this should actually introduce a global that only exists during this
function" problems. A simple and clean implementation with no weird
corners.
Fixes astral-sh/ty#14821 parent 2bc6c78 commit 9ce3230
3 files changed
Lines changed: 16 additions & 29 deletions
File tree
- crates/ty_python_semantic
- resources/mdtest/import
- src
- semantic_index
- types/infer
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 20 | + | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
949 | 947 | | |
950 | 948 | | |
951 | 949 | | |
952 | | - | |
953 | | - | |
954 | | - | |
| 950 | + | |
| 951 | + | |
955 | 952 | | |
956 | 953 | | |
957 | 954 | | |
958 | 955 | | |
959 | 956 | | |
960 | 957 | | |
961 | 958 | | |
| 959 | + | |
| 960 | + | |
962 | 961 | | |
963 | 962 | | |
964 | 963 | | |
965 | 964 | | |
966 | 965 | | |
967 | | - | |
968 | | - | |
| 966 | + | |
969 | 967 | | |
970 | 968 | | |
971 | 969 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1454 | 1454 | | |
1455 | 1455 | | |
1456 | 1456 | | |
| 1457 | + | |
1457 | 1458 | | |
1458 | 1459 | | |
1459 | 1460 | | |
| |||
1466 | 1467 | | |
1467 | 1468 | | |
1468 | 1469 | | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
| 1470 | + | |
| 1471 | + | |
1472 | 1472 | | |
1473 | 1473 | | |
1474 | 1474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5911 | 5911 | | |
5912 | 5912 | | |
5913 | 5913 | | |
5914 | | - | |
5915 | | - | |
5916 | | - | |
5917 | | - | |
5918 | | - | |
5919 | | - | |
5920 | | - | |
5921 | | - | |
5922 | | - | |
5923 | | - | |
5924 | | - | |
5925 | | - | |
5926 | | - | |
5927 | | - | |
| 5914 | + | |
| 5915 | + | |
| 5916 | + | |
5928 | 5917 | | |
5929 | 5918 | | |
5930 | 5919 | | |
| |||
0 commit comments