Commit c5394d8
committed
Count Any inside type aliases for overload ambiguity
Alias targets store a written Any as TypeOfAny.special_form, so
has_any_type ignored Nested = Sequence[Any] and picked the first
overload. That contradicted the new docs and the spec (aliases are
transparent). Count special-form Any only while expanding aliases.
Docs now include an alias example. Tests cover nested and bare Any
aliases, including the #15630 identity-check repro.1 parent 8e2f07b commit c5394d8
4 files changed
Lines changed: 70 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| |||
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
415 | 421 | | |
416 | 422 | | |
417 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6638 | 6638 | | |
6639 | 6639 | | |
6640 | 6640 | | |
| 6641 | + | |
| 6642 | + | |
| 6643 | + | |
| 6644 | + | |
6641 | 6645 | | |
6642 | 6646 | | |
6643 | | - | |
| 6647 | + | |
| 6648 | + | |
| 6649 | + | |
| 6650 | + | |
| 6651 | + | |
| 6652 | + | |
| 6653 | + | |
| 6654 | + | |
| 6655 | + | |
| 6656 | + | |
| 6657 | + | |
6644 | 6658 | | |
6645 | 6659 | | |
6646 | 6660 | | |
| |||
6856 | 6870 | | |
6857 | 6871 | | |
6858 | 6872 | | |
6859 | | - | |
6860 | | - | |
| 6873 | + | |
| 6874 | + | |
| 6875 | + | |
6861 | 6876 | | |
6862 | 6877 | | |
6863 | 6878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2086 | 2086 | | |
2087 | 2087 | | |
2088 | 2088 | | |
2089 | | - | |
2090 | | - | |
2091 | | - | |
2092 | | - | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
2093 | 2092 | | |
2094 | 2093 | | |
2095 | 2094 | | |
| |||
2103 | 2102 | | |
2104 | 2103 | | |
2105 | 2104 | | |
2106 | | - | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
2107 | 2142 | | |
2108 | 2143 | | |
2109 | 2144 | | |
| |||
0 commit comments