Commit ae789ca
authored
Fix incorrect fieldtype tfunc (#38148)
`fieldtype_tfunc` was returning `Type` as the widest possible return
value, but this is not correct, since fields of unwrapped DataTypes
can legally be TypeVars. This was in fact causing incorrect execution
in the isdefined_tfunc, though on master it happened to accidentally
do the correct thing. Fix this by returning `Any` rather than `Type`
as the widest type from `fieldtype_tfunc`, but while we're at it,
improve the precision of `fieldtype_tfunc` a bit, such that this
widening doesn't regress inference precision in some important cases.1 parent b8df95f commit ae789ca
File tree
3 files changed
+26
-13
lines changed- base/compiler
- test
- compiler
3 files changed
+26
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
300 | 298 | | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
304 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
| |||
975 | 978 | | |
976 | 979 | | |
977 | 980 | | |
978 | | - | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
979 | 984 | | |
980 | 985 | | |
981 | 986 | | |
| |||
1003 | 1008 | | |
1004 | 1009 | | |
1005 | 1010 | | |
1006 | | - | |
1007 | | - | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1008 | 1020 | | |
1009 | 1021 | | |
1010 | | - | |
| 1022 | + | |
1011 | 1023 | | |
1012 | 1024 | | |
1013 | 1025 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | | - | |
657 | | - | |
| 656 | + | |
| 657 | + | |
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| 676 | + | |
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
| |||
2828 | 2829 | | |
2829 | 2830 | | |
2830 | 2831 | | |
2831 | | - | |
2832 | | - | |
2833 | | - | |
2834 | | - | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
2835 | 2836 | | |
2836 | 2837 | | |
2837 | 2838 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
0 commit comments