Repository navigation
Commit 3b04203
committed
gh-162597: Mangle a private type parameter used before its definition
The symbol table added a generic class's type parameters to the set of
names to mangle one at a time, as it visited them. A bound, constraint or
default that referred to a later private type parameter was therefore
recorded unmangled, while the compiler mangled it with the complete set,
found no symbol and evaluated the bound with LOAD_NAME in a scope without
locals, raising SystemError.
Add all the type parameter names to the set before visiting any of them.1 parent 0423fc6 commit 3b04203
3 files changed
Lines changed: 51 additions & 3 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Core_and_Builtins
- Python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
933 | 950 | | |
934 | 951 | | |
935 | 952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1664 | 1664 | | |
1665 | 1665 | | |
1666 | 1666 | | |
1667 | | - | |
1668 | | - | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
1669 | 1694 | | |
1670 | 1695 | | |
1671 | 1696 | | |
1672 | | - | |
| 1697 | + | |
1673 | 1698 | | |
1674 | 1699 | | |
1675 | 1700 | | |
| |||
1986 | 2011 | | |
1987 | 2012 | | |
1988 | 2013 | | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
1989 | 2017 | | |
1990 | 2018 | | |
1991 | 2019 | | |
| |||
0 commit comments