Commit 232697e
authored
Avoid narrowing to unreachable at module level (#21144)
Helps with confusing symptoms in #21132
It is unfortunate that it makes the logic a little more ad hoc / might
lead to minimal repros being a little more confusing. But I think this
is still a better and more helpful state to be in than before
#20660 (relevant PR from the
narrowing rewrite).
Hopefully we can add the ability to check unreachable code, which will
fix this and other issues.1 parent 554fb8c commit 232697e
File tree
4 files changed
+42
-44
lines changed- mypy
- test-data/unit
4 files changed
+42
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6803 | 6803 | | |
6804 | 6804 | | |
6805 | 6805 | | |
6806 | | - | |
| 6806 | + | |
| 6807 | + | |
6807 | 6808 | | |
6808 | 6809 | | |
6809 | 6810 | | |
6810 | | - | |
| 6811 | + | |
| 6812 | + | |
| 6813 | + | |
6811 | 6814 | | |
6812 | 6815 | | |
6813 | 6816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2134 | 2134 | | |
2135 | 2135 | | |
2136 | 2136 | | |
2137 | | - | |
2138 | | - | |
2139 | | - | |
2140 | | - | |
2141 | | - | |
2142 | | - | |
2143 | | - | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
2144 | 2142 | | |
2145 | 2143 | | |
2146 | 2144 | | |
2147 | 2145 | | |
2148 | 2146 | | |
2149 | 2147 | | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
2153 | | - | |
2154 | | - | |
2155 | | - | |
2156 | | - | |
2157 | | - | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
2158 | 2153 | | |
2159 | 2154 | | |
2160 | 2155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2802 | 2802 | | |
2803 | 2803 | | |
2804 | 2804 | | |
2805 | | - | |
2806 | | - | |
2807 | | - | |
2808 | | - | |
2809 | | - | |
2810 | | - | |
2811 | | - | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
2812 | 2812 | | |
2813 | 2813 | | |
2814 | 2814 | | |
| |||
2818 | 2818 | | |
2819 | 2819 | | |
2820 | 2820 | | |
2821 | | - | |
2822 | | - | |
2823 | | - | |
2824 | | - | |
2825 | | - | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
2826 | 2826 | | |
2827 | 2827 | | |
2828 | 2828 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | 90 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
| |||
3151 | 3150 | | |
3152 | 3151 | | |
3153 | 3152 | | |
3154 | | - | |
| 3153 | + | |
| 3154 | + | |
3155 | 3155 | | |
3156 | | - | |
3157 | | - | |
3158 | | - | |
3159 | | - | |
3160 | | - | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
3161 | 3161 | | |
3162 | 3162 | | |
3163 | 3163 | | |
| |||
0 commit comments