Commit 350bac2
Preserve literal member type in enums
Summary:
Instead of promoting away the enum member's literal type, we preserve the unpromoted literal & change VisitMut to skip it. Then, in alt/class/enums.rs we modify some logic to decide when to promote away the literal & when to keep it.
The special enum attr resolution is weirdly complex because it deals with a bunch of different conditions like django and mixins. I'm not a big fan of how complex it is but it seems necessary.
closes facebook#2741
Reviewed By: grievejia
Differential Revision: D96157102
fbshipit-source-id: 69ae410dc1afcec9e3a4c290f7724a6560bdb38f1 parent 0562bf5 commit 350bac2
6 files changed
Lines changed: 289 additions & 131 deletions
File tree
- conformance/third_party
- crates/pyrefly_types/src
- pyrefly/lib
- alt/class
- test
- django
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5075 | 5075 | | |
5076 | 5076 | | |
5077 | 5077 | | |
5078 | | - | |
5079 | | - | |
5080 | | - | |
5081 | | - | |
5082 | | - | |
5083 | | - | |
5084 | | - | |
5085 | | - | |
5086 | | - | |
5087 | | - | |
5088 | | - | |
5089 | | - | |
5090 | | - | |
5091 | | - | |
5092 | | - | |
5093 | | - | |
5094 | | - | |
5095 | | - | |
5096 | | - | |
5097 | | - | |
5098 | | - | |
5099 | | - | |
5100 | | - | |
5101 | | - | |
5102 | | - | |
5103 | | - | |
5104 | | - | |
5105 | | - | |
5106 | | - | |
5107 | | - | |
5108 | | - | |
5109 | | - | |
5110 | | - | |
5111 | 5078 | | |
5112 | 5079 | | |
5113 | 5080 | | |
| |||
5144 | 5111 | | |
5145 | 5112 | | |
5146 | 5113 | | |
5147 | | - | |
5148 | | - | |
| 5114 | + | |
| 5115 | + | |
5149 | 5116 | | |
5150 | 5117 | | |
5151 | 5118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1762 | 1762 | | |
1763 | 1763 | | |
1764 | 1764 | | |
1765 | | - | |
1766 | | - | |
| 1765 | + | |
| 1766 | + | |
1767 | 1767 | | |
1768 | 1768 | | |
1769 | 1769 | | |
1770 | 1770 | | |
1771 | 1771 | | |
1772 | 1772 | | |
1773 | 1773 | | |
| 1774 | + | |
1774 | 1775 | | |
1775 | 1776 | | |
1776 | 1777 | | |
1777 | 1778 | | |
1778 | 1779 | | |
1779 | 1780 | | |
1780 | 1781 | | |
1781 | | - | |
| 1782 | + | |
| 1783 | + | |
1782 | 1784 | | |
1783 | | - | |
| 1785 | + | |
1784 | 1786 | | |
1785 | 1787 | | |
1786 | 1788 | | |
| |||
1864 | 1866 | | |
1865 | 1867 | | |
1866 | 1868 | | |
| 1869 | + | |
1867 | 1870 | | |
1868 | 1871 | | |
1869 | 1872 | | |
| |||
2105 | 2108 | | |
2106 | 2109 | | |
2107 | 2110 | | |
| 2111 | + | |
2108 | 2112 | | |
2109 | 2113 | | |
2110 | 2114 | | |
| |||
2114 | 2118 | | |
2115 | 2119 | | |
2116 | 2120 | | |
2117 | | - | |
| 2121 | + | |
2118 | 2122 | | |
2119 | 2123 | | |
2120 | 2124 | | |
| |||
3993 | 3997 | | |
3994 | 3998 | | |
3995 | 3999 | | |
3996 | | - | |
3997 | | - | |
3998 | | - | |
3999 | | - | |
4000 | | - | |
| 4000 | + | |
| 4001 | + | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
4001 | 4015 | | |
4002 | 4016 | | |
4003 | 4017 | | |
| |||
0 commit comments